Skip to content

Add support for aria-hidden/accessibilityElementsHidden prop. #14560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Draft Implemenation",
"packageName": "react-native-windows",
"email": "satkh@microsoft.com",
"dependentChangeType": "patch"
}
3 changes: 3 additions & 0 deletions packages/playground/Samples/accessible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export default class Bootstrap extends React.Component<
<Text style={styles.text}>TEST setAccessibilityFocus</Text>
</TouchableHighlight>
<TextInput ref={this.myElement} />
<View style={styles.item} accessibilityElementsHidden={true}>
<Text style={styles.text}>TEST Accessibility Hidden </Text>
</View>
</View>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const UIView = {
accessibilityShowsLargeContentViewer: true,
accessibilityLargeContentTitle: true,
importantForAccessibility: true,
accessibilityElementsHidden: false,
nativeID: true,
testID: true,
renderToHardwareTextureAndroid: true,
Expand Down
6 changes: 4 additions & 2 deletions vnext/src-win/Libraries/Components/View/View.windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ const View: component(
// [Windows
accessible={_accessible}
children={
importantForAccessibility === 'no-hide-descendants'
importantForAccessibility === 'no-hide-descendants' ||
accessibilityElementsHidden === true
? childrenWithImportantForAccessibility(otherProps.children)
: otherProps.children
}
Expand Down Expand Up @@ -327,7 +328,8 @@ const View: component(
// [Windows
accessible={_accessible}
children={
importantForAccessibility === 'no-hide-descendants'
importantForAccessibility === 'no-hide-descendants' ||
accessibilityElementsHidden === true
? childrenWithImportantForAccessibility(otherProps.children)
: otherProps.children
}
Expand Down