Skip to content

Open a dropdown menu for a screen reader like a popup one - #363

Open
rezabakhshilaktasaraei wants to merge 1 commit into
desktop-app:masterfrom
rezabakhshilaktasaraei:dropdown-menu-screen-reader
Open

Open a dropdown menu for a screen reader like a popup one#363
rezabakhshilaktasaraei wants to merge 1 commit into
desktop-app:masterfrom
rezabakhshilaktasaraei:dropdown-menu-screen-reader

Conversation

@rezabakhshilaktasaraei

Copy link
Copy Markdown
Contributor

A PopupMenu shown 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. A DropdownMenu (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.

  • InnerDropdown gets a shown callback, fired once the content is visible (after the show animation, or at once for showFast), mirroring the hidden callback.
  • DropdownMenu uses it to select the first item in screen reader mode, like PopupMenu does.
  • A selected menu item forces its lazy accessibility registration, so it can take the focus even when the screen reader has not queried it yet (a popup's new window gets queried, a menu inside the window may not).

Focus returns to the toggle on hide through the existing save/return logic. Mouse behaviour is unchanged.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant