Skip to content

Commit 2a3d836

Browse files
javachefacebook-github-bot
authored andcommitted
Reuse TouchableHighlight accessibility state without ARIA overrides (#59807)
Summary: Use the supplied `accessibilityState` as the default and only build a new state object when an ARIA state prop overrides it. This avoids reconstructing a sparse state object with extra undefined fields when no ARIA override is supplied. ARIA precedence and the explicit `disabled` override are unchanged. Refresh the affected snapshots and assert that the button keeps its empty accessibility state. Changelog: [Internal] Differential Revision: D129885143
1 parent 0e4af15 commit 2a3d836

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,8 @@ class TouchableHighlightImpl extends React.Component<
231231
'aria-selected': ariaSelected,
232232
} = this.props;
233233

234-
let _accessibilityState: ?AccessibilityState;
234+
let _accessibilityState: ?AccessibilityState = accessibilityState;
235235
if (
236-
accessibilityState != null ||
237236
ariaBusy != null ||
238237
ariaChecked != null ||
239238
ariaDisabled != null ||

0 commit comments

Comments
 (0)