Open a dropdown menu for a screen reader like a popup one - #363
Open
rezabakhshilaktasaraei wants to merge 1 commit into
Open
Open a dropdown menu for a screen reader like a popup one#363rezabakhshilaktasaraei wants to merge 1 commit into
rezabakhshilaktasaraei wants to merge 1 commit into
Conversation
A popup menu shown in screen reader mode opens as if from the keyboard: its first item is selected, takes the focus and is announced, and the arrows go on from there. A dropdown menu - the attach menu of the composer, the "send as" menu - just appeared inside the window with nothing selected, so a screen reader had nothing to say and the keyboard stayed where it was. Select the first item the same way, once the dropdown is fully shown: InnerDropdown reports that moment through a shown callback, as it does for hiding, because an item selected while the content is still hidden behind the show animation could not hold the focus. The focus policy of an item is granted lazily, when the screen reader first queries it - a popup is queried as its window appears, a menu inside the window may not have been - so a selected item asks for its interface first. The focus returns to where it was when the dropdown hides, as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
PopupMenushown in screen reader mode opens as if from the keyboard: the first item is selected, takes the focus and is announced, arrows go on from there. ADropdownMenu(the attach menu of the composer, "send as") just appeared inside the window with nothing selected, so a screen reader had nothing to say and Space on the paperclip seemed to do nothing.InnerDropdowngets a shown callback, fired once the content is visible (after the show animation, or at once forshowFast), mirroring the hidden callback.DropdownMenuuses it to select the first item in screen reader mode, likePopupMenudoes.Focus returns to the toggle on hide through the existing save/return logic. Mouse behaviour is unchanged.