Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make Popover initial focus work with screen readers. #5732
Te current implementation of the initial focus in the Popover component doesn't work when a screen reader is running. Screen readers intercept key presses, and they pass them back to the browsers only in specific circumstances. For example, when in "forms mode", or when in an ARIA widget with a specific ARIA role that expects specific keyboard events to happen.
In most of the other cases the browser is unaware a keyboard event has happened. In this specific case, this prevents the initial focus to be correctly set on the Popover component.
For more details and testing, please refer to the related issue, particularly to this comment: #5559 (comment)
Also, as noted in the related issue, many users are not exclusively "mouse users" or "keyboard users". Implementing the initial focus in a way that works only when there's the assumption a keyboard is being used wouldn't serve well users who make a mixed use of mouse and keyboard, or other devices.
Note: the patch removes a related test.