Open maxsynnott opened 1 week ago
@wingkwong Can i look into this?
@wingkwong Can i look into this?
@wingkwong Quick question, what should be the expected behavior when minValue
is greater than maxValue
? Should we disable all dates or do we have to adjust the minValue
so that it cannot exceed maxValue
?
lemme get back to you later.
This issue is a bug in React Aria. As a temporary fix, you could make the value controlled and implement the check before passing it.
NextUI Version
2.4.8
Describe the bug
If you provide the DatePicker component with a minValue that is larger/later than maxValue it will crash with a React Too many re-renders error when trying to open the calendar
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
<DatePicker minValue={now("Etc/UTC").add({ days: 1 })} maxValue={now("Etc/UTC")} />
Expected behavior
The calendar will open with all days disabled
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome