From 3ebc86a3a5c482a2e4f50fbd3f547a44cc1a3edf Mon Sep 17 00:00:00 2001 From: Basith <134603758+abdulbasithqb@users.noreply.github.com> Date: Tue, 9 Jan 2024 04:49:49 +0700 Subject: [PATCH] fix: improve screen reader experience by fixing redundant FAB.Group item announcements. (#4196) --- src/components/FAB/FABGroup.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/FAB/FABGroup.tsx b/src/components/FAB/FABGroup.tsx index cdabe6aa7d..af1e85c4cb 100644 --- a/src/components/FAB/FABGroup.tsx +++ b/src/components/FAB/FABGroup.tsx @@ -382,6 +382,10 @@ const FABGroup = ({ }, ]} pointerEvents={open ? 'box-none' : 'none'} + accessibilityRole="button" + importantForAccessibility="yes" + accessible={true} + accessibilityLabel={accessibilityLabel} > {it.label && ( @@ -392,8 +396,8 @@ const FABGroup = ({ close(); }} accessibilityHint={it.accessibilityHint} - accessibilityLabel={accessibilityLabel} - accessibilityRole="button" + importantForAccessibility="no-hide-descendants" + accessibilityElementsHidden={true} style={[ styles.containerStyle, { @@ -410,6 +414,8 @@ const FABGroup = ({ > @@ -431,13 +437,13 @@ const FABGroup = ({ isV3 && { transform: [{ translateY: translations[i] }] }, it.style, ]} + accessibilityElementsHidden={true} theme={theme} onPress={(e) => { it.onPress(e); close(); }} - accessibilityLabel={accessibilityLabel} - accessibilityRole="button" + importantForAccessibility="no-hide-descendants" testID={it.testID} visible={open} rippleColor={it.rippleColor}