-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
DatePicker: Add option to not auto-open on focus #1451
Conversation
Does it ever make sense to open it immediately on keyboard focus? Maybe instead of this being an option we should just remove the functionality entirely. |
@mikewheaton If you're happy to make that API change, we can go for it. @scriby: do you see a scenario where auto-opening the date-picker is the correct behavior? |
From the standpoint of supporting screenreaders, I think it's much more understandable to require the user to take an explicit action to open the popup than to just launch them into it without context. So, I think it's a reasonable stance to take that we don't allow the date picker to open automatically on focus. Whether or not a third party might want that behavior regardless some day is another story... |
@c-w , @mikewheaton I think we should go through the accessible date pickers listed at http://www.webaxe.org/accessible-date-pickers/ and decide on the design. There are both types 1. ones that open the picker popup on focus and 2. others that provide a focusable picker button next to date text box. |
While we have the conversation about the focus-open behavior, I split out #1477 for the tab-order changes as the fix is valuable on its own. |
This is a fix for issue 1 mentioned in #1266
@mdahamiwal @mikewheaton: Did you take a decision on whether you want the always/never auto-open behavior or whether you'd prefer to make it configurable? |
Let's just make it an option for now, as both look like valid options :) |
@mikewheaton: Thanks for the decision. This pull request adds the new option to disable auto-open on focus of the date picker. Could you please give it a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
@mikewheaton: Thanks for the sign-off. Could you please merge this in before master advances again? I don't have merge-access. |
Pull request checklist
Description of changes
When focus lands on the date picker, it currently immediately opens the date picker. This is confusing from an accessibility point of view. This pull request adds an option to disable the auto-open behavior so that the user can open the date picker manually, e.g. by hitting enter.
Focus areas to test
Test steps (verified manually on DatePicker.Input.Example: screencast):