You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[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
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.
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.
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.
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.
Activity
Yajur-Grover commentedon Feb 28, 2024
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.
Yajur-Grover commentedon Feb 29, 2024
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 thedisabledprop, similar to microsoft/react-native-windows#12457.chrisglein commentedon Feb 29, 2024
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.