From e6d20349facf35a8244f347083741c380d806468 Mon Sep 17 00:00:00 2001 From: Getabalew Tesfaye Date: Tue, 21 Nov 2023 10:04:19 +0300 Subject: [PATCH 1/2] fix wrong cursor style based on accessibility role --- .../Pressable/GenericPressable/BaseGenericPressable.tsx | 2 +- src/components/Pressable/GenericPressable/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx b/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx index 1576fe18da54..e10f9088d653 100644 --- a/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx +++ b/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx @@ -132,7 +132,7 @@ function GenericPressable( onPressIn={!isDisabled ? onPressIn : undefined} onPressOut={!isDisabled ? onPressOut : undefined} style={(state) => [ - getCursorStyle(shouldUseDisabledCursor, [rest.accessibilityRole, rest.role].includes('text')), + getCursorStyle(shouldUseDisabledCursor, [rest.accessibilityRole, rest.role].includes('presentation')), StyleUtils.parseStyleFromFunction(style, state), isScreenReaderActive && StyleUtils.parseStyleFromFunction(screenReaderActiveStyle, state), state.focused && StyleUtils.parseStyleFromFunction(focusStyle, state), diff --git a/src/components/Pressable/GenericPressable/index.tsx b/src/components/Pressable/GenericPressable/index.tsx index e0436c26c8fe..523db81863f4 100644 --- a/src/components/Pressable/GenericPressable/index.tsx +++ b/src/components/Pressable/GenericPressable/index.tsx @@ -14,7 +14,7 @@ function WebGenericPressable({focusable = true, ...props}: PressableProps, ref: // change native accessibility props to web accessibility props focusable={focusable} tabIndex={!accessible || !focusable ? -1 : 0} - role={props.accessibilityRole as Role} + role={props.role as Role} id={props.nativeID} aria-label={props.accessibilityLabel} aria-labelledby={props.accessibilityLabelledBy} From f80cf828a546d6d2083bedad905be1f78538964c Mon Sep 17 00:00:00 2001 From: Getabalew Tesfaye Date: Tue, 21 Nov 2023 10:29:12 +0300 Subject: [PATCH 2/2] fix lint --- src/components/Pressable/GenericPressable/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Pressable/GenericPressable/index.tsx b/src/components/Pressable/GenericPressable/index.tsx index 523db81863f4..b3b1ff13f5f9 100644 --- a/src/components/Pressable/GenericPressable/index.tsx +++ b/src/components/Pressable/GenericPressable/index.tsx @@ -1,5 +1,5 @@ import React, {ForwardedRef, forwardRef} from 'react'; -import {Role, View} from 'react-native'; +import {View} from 'react-native'; import GenericPressable from './BaseGenericPressable'; import PressableProps from './types'; @@ -14,7 +14,7 @@ function WebGenericPressable({focusable = true, ...props}: PressableProps, ref: // change native accessibility props to web accessibility props focusable={focusable} tabIndex={!accessible || !focusable ? -1 : 0} - role={props.role as Role} + role={props.role} id={props.nativeID} aria-label={props.accessibilityLabel} aria-labelledby={props.accessibilityLabelledBy}