-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[a11y]: Datepicker opens calendar on focus, but does not dismiss on loss of focus; also cannot dismiss with Esc #12594
Comments
Part of this was recently addressed in #12567 (closing on esc). It still remains open on loss of focus, however |
@tw15egan sorry I missed that. Definitely an improvement. Not yet in the React storybook, I think. |
@mbgower no worries, it was just merged in. Just wanted to make a note of it 👍🏻 |
@sstrubberg with the resolution of the Esc key behaviour, I think the failure to close on loss of focus is not so clearly a failure until WCAG 2.2 comes into force,, so I'll reluctantly agree it can be sev 3, not 2. |
Hey! Any updates about it? |
hey @OleksandrDzindziura no immediate updates yet. I've added this to a larger work-stream we are building around WCAG 2.2 readiness that we will soon get to. Happy to take any contributions if you want to open a PR. |
Package
@carbon/react
Browser
Chrome
Operating System
MacOS
Package version
https://react.carbondesignsystem.com/?path=/story/components-datepicker--single-with-calendar#storybook-preview-wrapper
React version
No response
Automated testing tool and ruleset
n/a
Assistive technology
No response
Description
I'm spinning this issue off from the larger issue on keyboard affordances in the datepicker, #11800. It looks like that work will be rolled into the V12 datepicker update; however, I think the on-focus behaviour is different enough, and of a higher order of disruption, that it should be given its own assessment and a higher priority, especially if the v12 datepicker release isn't impending.
The following is pretty much what I documented in a comment in the other issue back in July.
Carbon's react implementation of a date input with a calendar departs significantly from this stock HTML interaction, in the following ways:
These three items compounded constitute a real possible problem for keyboard users. The calendar could be covering other content info and there is no apparent way to dismiss.
It IS closed when the keyboard is in the calendar itself and Esc is pressed, however, it is not intuitive or consistent how a user moves from the input to the calendar.
The solution to this issue is fairly simple:
The behaviour is definitely not delightful. It is a debatable failure of 2.1.1 Keyboard. There is a method of operating by keyboard. It's just not expected, and is very cumbersome. It also verges on a failure of 1.4.13 Content on Hover of Focus, but since the calendar does not go away on loss of focus, it fails the spirit of the SC without the normative wording. Finally, it is debatable whether it represents a potential failure of Focus Visible (since the calendar can entirely obscure an item with focus). It will definitely fail WCAG 2.2's Focus Not Obscured, but that will not be required until the second half of 2023 at the earliest.
WCAG 2.1 Violation
see note in description
Reproduction/example
https://react.carbondesignsystem.com/?path=/story/components-datepicker--single-with-calendar#storybook-preview-wrapper
Steps to reproduce
Persistent and non-dismissible calendar
Inconsistent date input <> calendar operation
Code of Conduct
The text was updated successfully, but these errors were encountered: