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
When using the Pressable component from react-native, the onPress prop does not trigger when the role="link" and the element has focus and "enter" is tapped from the keyboard. The only way currently to have "enter" trigger a Pressable with role="link" is to use onPressOut.
Expected behavior
When a Pressable has onPress and role="link" clicking and hitting "enter" on the Pressable should trigger onPress
Steps to reproduce
Use <Pressable role="link" onPress={() => console.log("onPress triggered")} />
Is there an existing issue for this?
Describe the issue
When using the
Pressable
component from react-native, theonPress
prop does not trigger when the role="link" and the element has focus and "enter" is tapped from the keyboard. The only way currently to have "enter" trigger aPressable
with role="link" is to useonPressOut
.Expected behavior
When a
Pressable
hasonPress
androle="link"
clicking and hitting "enter" on thePressable
should triggeronPress
Steps to reproduce
<Pressable role="link" onPress={() => console.log("onPress triggered")} />
Test case
https://codesandbox.io/p/sandbox/clever-joana-w2r4hd?file=%2Fsrc%2FApp.js
Additional comments
The reason this is coming up is because of an accessibility audit we are going through where button that act as links need to be marked up as so.
The text was updated successfully, but these errors were encountered: