software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

[Pressable] Add keyboard support #2988

Closed latekvo closed 3 months ago

latekvo commented 4 months ago

Description

Current implementation of Pressable does not allow for keyboard input. Keyboard input is an important accessibility feature present on most if not all other gh components, and all the core ones.

Here is a preview of the issue - as it is visible, I am unable to press the Pressable with the enter key.

https://github.com/software-mansion/react-native-gesture-handler/assets/74246391/7bae06b0-419b-4efc-a9c8-a320c5560180

blocked by: #2981 no longer blocked

Steps to reproduce

  1. Create a legacy and a gesturized Pressable component in one View.
  2. Add press indicators to both of the pressables (e.g.: functional styles)
  3. Start navigating with keyboard
  4. When over the legacy Pressable, press enter - element gets activated.
  5. When over the gesturized Pressable, press enter - no action happens.

Snack or a link to a repository

https://github.com/software-mansion/react-native-gesture-handler/blob/%40latekvo/fix-pressable-event-propagation/example/src/release_tests/nestedPressables/index.tsx

Gesture Handler version

n/a

React Native version

n/a

Platforms

Web

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

Web - all browsers

Acknowledgements

Yes

github-actions[bot] commented 4 months ago

Hey! đŸ‘‹

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

latekvo commented 3 months ago

Implemented by: #3035