[V9] Dropdown with disabled options #2382
-
Hello everyone, asking for your help here because I'm not sure if this is a bug or not. In previous discussions, I thought that using the I also tried to disable those options by using a custom dropdown but unless there is a way to know if the dropdown is used for months or years, I can't do it reliably. I have setup a very simple Codesandbox example to illustrate what I write. When I look at older examples, it looks like every year in the year dropdown before 2022 should be disabled. If I missed something obvious or if the prop or Calendar are not used properly, please let me know. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @theosenoussaoui, the dropdowns are disabled by using the <DayPicker
mode="single"
captionLayout="dropdown"
selected={selected}
onSelect={setSelected}
- disabled={{ before: new Date(2019, 1, 2) }}
+ startMonth={new Date(2019, 1)}
required
/> See https://daypicker.dev/docs/customization#caption-dropdown The |
Beta Was this translation helpful? Give feedback.
Hi @theosenoussaoui, the dropdowns are disabled by using the
startMonth
,endMonth
props:See https://daypicker.dev/docs/customization#caption-dropdown
The
disabled
prop is used to disable days.