We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the calendar in range selection mode as a controlled component the first date selection of a range is currently not clearable.
Example: https://codesandbox.io/p/sandbox/react-calendar-example-6gq3tr
Setting the calendars value to null should reset a single date selection in selectRange mode
null
Single date selection is not clearable while in selectRange mode
Looks like this code is responsible:
https://github.com/wojtekmaj/react-calendar/blob/main/packages/react-calendar/src/Calendar.tsx#L692
// In the middle of range selection, use value from state if (selectRange && getIsSingleValue(valueState)) { return valueState; }
React-Calendar version: 5.0.0 React version: 18.0.2
The text was updated successfully, but these errors were encountered:
@tayoawoyemi have you found a way to solve this problem?
Sorry, something went wrong.
only re-rendering helps me
<ReactCalendar key={rerenderKey} ... />
Same issue here, and ended up with the same solution of forcing a a re-mount of the component by changing the key
No branches or pull requests
Before you start - checklist
Description
When using the calendar in range selection mode as a controlled component the first date selection of a range is currently not clearable.
Steps to reproduce
Example: https://codesandbox.io/p/sandbox/react-calendar-example-6gq3tr
Expected behavior
Setting the calendars value to
null
should reset a single date selection in selectRange modeActual behavior
Single date selection is not clearable while in selectRange mode
Additional information
Looks like this code is responsible:
https://github.com/wojtekmaj/react-calendar/blob/main/packages/react-calendar/src/Calendar.tsx#L692
// In the middle of range selection, use value from state if (selectRange && getIsSingleValue(valueState)) { return valueState; }
Environment
React-Calendar version: 5.0.0
React version: 18.0.2
The text was updated successfully, but these errors were encountered: