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
  • Loading branch information
mountiny authored Nov 9, 2023
2 parents 9862a3e + bbc54c3 commit 1da5e43
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 1da5e43

Please sign in to comment.