Touchable focus events not triggering with keyboard (needed for accessibility) #45252
Labels
API: Keyboard
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Description
I am trying to add custom focus styles if a pressable is focused to make the keyboard focus visible in any case (dark/light mode, different background colors etc).
It seems like
TouchableOpacity
andTouchableHightlight
both get forwarded fromTouchableWithoutFeedback
, which has theonFocus
andonBlur
events. I was trying to hold a focus state with these events to render styles dynamically. However, they do not get triggered at all, even if I useTouchableWithoutFeedback
, which leads me to think that's the culprit.Accessibility requires visibility of focus states. Is there another way to retrieve focus states?
Steps to reproduce
Here's a little example:
React Native Version
0.74.3
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/proohit/focus-example
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: