Skip to content

Commit

Permalink
fix: add value prop to select month/year
Browse files Browse the repository at this point in the history
  • Loading branch information
lew-cold committed Jan 2, 2025
1 parent 2911a98 commit 91d8141
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/calendarPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,22 @@ export const CalendarPanel: React.FC<CalendarPanelProps> = ({
/>
{showYearMonthPicker ? (
<Flex flexDir="row">
<Select onChange={handleMonthChange} {...propsConfigs?.monthSelectProps}>
<Select
onChange={handleMonthChange}
{...propsConfigs?.monthSelectProps}
value={calendar.month}
>
{configs.monthNames.map((month, idx) => (
<option key={idx} value={idx}>
{month}
</option>
))}
</Select>
<Select onChange={handleYearChange} {...propsConfigs?.yearSelectProps}>
<Select
onChange={handleYearChange}
{...propsConfigs?.yearSelectProps}
value={calendar.year}
>
{configs.years.map((year, idx) => (
<option key={idx} value={year}>
{year}
Expand Down

0 comments on commit 91d8141

Please sign in to comment.