Skip to content

[V9] Dropdown with disabled options #2382

Answered by gpbl
theosenoussaoui asked this question in Support
Discussion options

You must be logged in to vote

Hi @theosenoussaoui, the dropdowns are disabled by using the startMonth, endMonth props:

<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 disabled prop is used to disable days.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@theosenoussaoui
Comment options

@gpbl
Comment options

gpbl Sep 8, 2024
Maintainer

Answer selected by theosenoussaoui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants