Skip to content
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

Mobile: Fixes #10253: Move accessibility focus to first menu option once it opens #10333

Closed
wants to merge 2 commits into from

Conversation

Sidd-R
Copy link
Contributor

@Sidd-R Sidd-R commented Apr 19, 2024

Summary

On opening the note menu, moved the accessibility focus to the first item in it using AccessibilityInfo.setAccessibilityFocus

Rationale

  1. added a ref to the first item in the note menu
  2. when the onOpen event of the Menu is triggered, set the accessibility focus to first item using ref.
  3. used setTimeout because the value of ref was initially null for a few milliseconds.

Demo

Screenrecorder-2024-04-19-10-04-26-301.mp4

Manual Testing

  1. Enable TalkBack
  2. Open a note
  3. Focus the note actions button (top right of screen)
  4. Activate it (double-tap), the focus should move to the first item on the menu
  5. Move focus to the next item (swipe right), the focus goes to the second item on the menu

Tested successfully on android 13 physical device

if (menuFirstItem) {
AccessibilityInfo.setAccessibilityFocus(menuFirstItem);
}
}, 500);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried moving menuComp to a separate component then using useEffect and a few other things but it did not work out, so resorted to using setTimeout in the end

@laurent22
Copy link
Owner

i will close this for now as there's unfortunately too many issues

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.

Accessibility: Screen reader focus stays on the open menu button when the note actions menu is opened
2 participants