Skip to content

[React Native Gallery -> Pressable]: Keyboard focus and narrator focus are not on sync when user navigate to 'Disabled Pressable' button from 'Press me' button. #364

Closed
microsoft/react-native-windows
#12799

Description

@YajurG

Pre-Requisite:
Turn on Narrator (CTRL+WINDOWS+ENTER)

Repro-Steps:

  • Launch the React Native Gallery app.
  • Navigate to ‘Pressable’ button and invoke it.
  • Now hit tab key from 'Press me' button and observe the keyboard focus and narrator focus.

Actual Result:

Keyboard focus and narrator focus are not on sync when user navigate to 'Disabled Pressable' button from 'Press me' button. When user hit tab key from 'Press me' button keyboard focus is landing on 'Disabled Pressable' button, but narrator focus stays on 'Press me' and remains silent.

Expected Result:

Keyboard focus and narrator focus should be on sync and narrator have to announce about it. When user navigate from 'Press me' button keyboard focus and narrator focus should land on 'Disabled Pressable' button and narrator should announce as "Disabled Pressable, button, disable".

User Impact:

Users with visual impairment who rely on screen reader will get confused if narrator focus and Keyboard focus are not sync.

Internal issue link: https://dev.azure.com/microsoft/OS/_workitems/edit/47843649

Activity

  1. Yajur-Grover commented on Feb 28, 2024

    @Yajur-Grover
    Contributor

    I tried debugging this issue and it looks like narrator is not focusing on the prop because the disabled property is set. If I remove the disabled={true} prop from the pressable example, then narrator shifts focus onto the disabled pressable example. This may be an issue caused by microsoft/react-native-windows#12457, where the platform code isn't recognizing the disabled prop, and is therefore allowing keyboard focus on to the disabled prop.

    Not sure what the exact expected behavior is for a disabled pressable. If it is expected that you can focus on to a disabled pressable, but cannot press it, then it looks like this is a narrator issue and potentially outside our scope. However, if the expected behavior is to never be able to have keyboard focus on to a disabled pressable, then there are likely some changes we need to make to the pressable behavior, similar to the issue linked above.

    Chris Glein (@chrisglein) Chiara Mooney (@chiaramooney) adding you for additional perspective.

  2. Yajur-Grover commented on Feb 29, 2024

    @Yajur-Grover
    Contributor

    I tested a disabled Pressable on a simple Expo snack here, and it looks like on RN core, when disabled={true}, you can't focus on the pressable at all through keyboard tab input. Going to assume that's the expected behaviour, which means there's an issue with the pressable code not recognizing the disabled prop, similar to microsoft/react-native-windows#12457.

  3. chrisglein commented on Feb 29, 2024

    @chrisglein
    Member

    However, if the expected behavior is to never be able to have keyboard focus on to a disabled pressable, then there are likely some changes we need to make to the pressable behavior, similar to the issue linked above.

    That would be my expectation. A disabled Pressable should not be tabbed to.

    Compare with WinUI. Launch their gallery, got the button page, and click the "Disable button" checkbox. Then try to tab around. That Button cannot be selected with tab navigation.

    Note that there is a separate mechanism for inspecting disabled components, scan mode. With that you should be able to see the component. But not normal tab navigation.

    So that's the issue here. Our disabled item is still tab navigatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A11ySev2Area: Accessibilitybug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions