-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
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
Selecting unavailable dates with keyboard selects previous avaialable date in Calendar, DatePicker, useCalendarState, etc #5692
Comments
Hi, just had a look at this. A fix in |
@richardbann perhaps you can fork my code sandbox to demonstrate that your update resolves this |
@richardbann FWIW, I've made your update locally and it appears to resolve my use case. |
Selecting unavailable dates with keyboard selects previous avaialable date in Calendar, DatePicker, useCalendarState, etc
Provide a general summary of the issue here
The documentation says that while unavailable dates remain focusable, they cannot be selected. However, when keyboard users attempt to select an unavailable date, the next available previous date is selected. This is completely unexpected. Attempting to select an unavailable date with a keyboard should do nothing, just like it does with a mouse.
🤔 Expected Behavior?
No value should be set.
😯 Current Behavior
The first available date prior to the selection is selected.
💁 Possible Solution
It appears that this is a result #3005 making changes to the
setValue
in useCalendarState.tsIt looks like #3005 attempted to make it changes only when "blurring a RangeCalendar while in the middle of a selection", yet its changes appear to be affecting every time the value is changed.
A possible solution would be to completely undo the changes that #3005 makes to setValue or to modify them to only affect the blurring of a RangeCalendar in the middle of selection.
🔦 Context
No response
🖥️ Steps to Reproduce
Here is a modified example that makes the current date unavailable. Use the keyboard to navigate to today and attempt to select it. You will receive an alert stating yesterday's date and you will see yesterday selected.
https://codesandbox.io/p/sandbox/intelligent-shape-ghv2v2
Version
latest
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Mac OS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: