Skip to content

Commit 113da2a

Browse files
authored
fix: [IOBP-1254] Add the correct accessibilityState to the TabItem (#422)
## Short description This PR adds the correct `accessibilityState` to the `TabItem` component replacing from `selected` to `checked` because only with the selected prop, the screen reader announces only if the tab is selected and not if it's not selected. ## List of changes proposed in this pull request - Replaced `selected` accessibilityState proper with the `checked` prop; ## Preview |Before|After| |-|-| |<video src="https://github.com/user-attachments/assets/d35354de-a087-463d-a7d2-57ca6bcbe855" />|<video src="https://github.com/user-attachments/assets/c166a9f1-ed41-4854-8b1e-4e389c22dee0" />
1 parent f50bf0d commit 113da2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/tabs/TabItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const TabItem = forwardRef(
189189
accessibilityLabel={accessibilityLabel}
190190
accessibilityHint={accessibilityHint}
191191
accessibilityRole={"button"}
192-
accessibilityState={{ selected }}
192+
accessibilityState={{ checked: !!selected }}
193193
testID={testID}
194194
onPress={handleOnPress}
195195
onPressIn={onPressIn}

0 commit comments

Comments
 (0)