Replies: 2 comments
-
| 
 Yeah, I see what you mean - thanks for the detailed report. As a workaround, you could add a custom  The following should work: <DayPicker
-   disabled={disabledDays}
+   modifiers={{ disabled: disabledDays }
+   modifiersClassNames={{
+      disabled: 'rdp-disabled',
+   }}
/>Not sure about the fix to the DayPicker source code. Ideally, if you want a custom selection, you should not use  I'll check out your sandbox and see if I can come up with a better solution! | 
Beta Was this translation helpful? Give feedback.
-
| Thanks, a custom modifier like this worked as well: <DayPicker
    disabled={disabledDays}
    {...(selectedRange?.from &&
        !selectedRange?.to && {
            modifiers: {
                selectedFrom: [selectedRange.from],
            },
            modifiersClassNames: {
                selectedFrom: 'rdp-selected !opacity-100',
            },
        })}
/> | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Code
When using
onDayClickfor custom selection behavior, disabling thefromday after clicking it won't give it therdp-selectedclass. This used to work in v8, there it got bothrdp-disabledandrdp-selected.See this codesandbox
Also note the empty function in
onSelect, it's needed foronDayClickto work since that makes the component controlled in v9.Expected Behavior
A disabled selected
fromday should have bothrdp-disabledandrdp-selected. So you can see the start of the selection even with the day being disabled.Actual Behavior
In v9,
rdp-selectedisn't added, so you don't see the start of the selection.Screenshots
Beta Was this translation helpful? Give feedback.
All reactions