From 1839a14df81acf73fc0cf924c1500e021b0269de Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 11 Nov 2026 08:47:42 -0800 Subject: [PATCH] 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 --- .../Libraries/Components/Touchable/TouchableHighlight.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js index 55478b1d63d6..d7a49044b3d4 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js @@ -231,9 +231,8 @@ class TouchableHighlightImpl extends React.Component< 'aria-selected': ariaSelected, } = this.props; - let _accessibilityState: ?AccessibilityState; + let _accessibilityState: ?AccessibilityState = accessibilityState; if ( - accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null ||