Skip to content

Commit

Permalink
Merge pull request #31118 from tienifr/fix/31098
Browse files Browse the repository at this point in the history
[CP Staging] Fix: Cannot navigate by `Tab` key

(cherry picked from commit 1da5e43)
  • Loading branch information
mountiny authored and OSBotify committed Nov 9, 2023
1 parent 76f9b5a commit f07ae2a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Pressable/GenericPressable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import {Role, View} from 'react-native';
import GenericPressable from './BaseGenericPressable';
import PressableProps from './types';

function WebGenericPressable(props: PressableProps, ref: ForwardedRef<View>) {
function WebGenericPressable({focusable = true, ...props}: PressableProps, ref: ForwardedRef<View>) {
const accessible = props.accessible ?? props.accessible === undefined ? true : props.accessible;

return (
<GenericPressable
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={ref}
// change native accessibility props to web accessibility props
tabIndex={!props.accessible || !props.focusable ? -1 : 0}
focusable={focusable}
tabIndex={!accessible || !focusable ? -1 : 0}
role={props.accessibilityRole as Role}
id={props.nativeID}
aria-label={props.accessibilityLabel}
Expand Down

0 comments on commit f07ae2a

Please sign in to comment.