Skip to content

fix(macos): align TouchableBounce focusable + AccessibilityInfo guards with upstream 0.83#2964

Open
tvinhas wants to merge 1 commit into
microsoft:0.83-mergefrom
tvinhas:fix-macos-js-layer-0.83-three-way-merge-audit
Open

fix(macos): align TouchableBounce focusable + AccessibilityInfo guards with upstream 0.83#2964
tvinhas wants to merge 1 commit into
microsoft:0.83-mergefrom
tvinhas:fix-macos-js-layer-0.83-three-way-merge-audit

Conversation

@tvinhas
Copy link
Copy Markdown

@tvinhas tvinhas commented May 13, 2026

Summary

Two small JS-layer cleanups surfaced by a three-way-merge audit of fork-patched Libraries/Components/** files after the 0.83 upstream merge. Both fixes address divergence between the fork's [macOS] patches and upstream's restructured
0.83 logic.

1. TouchableBounce.js — missing onPress guard in macOS focusable check

Upstream 0.83 changed the focusable prop on the inner <Animated.View> of TouchableBounce.render() from:

focusable={this.props.focusable !== false && !this.props.disabled}

to:

focusable={
  this.props.focusable !== false &&
  this.props.onPress !== undefined &&
  !this.props.disabled
}

The fork's [macOS] block — which replaces the upstream <Animated.View> prop set with a macOS-specific set including acceptsFirstMouse, enableFocusRing, tooltip, mouse/drag handlers, etc. — kept the pre-0.83 focusable shape, missing the
new onPress !== undefined guard. Effect on macOS: a TouchableBounce without an onPress prop is still Tab-focusable / VoiceOver-reachable, even though it has no interaction. Decorative wrappers wrongly grab keyboard focus.

Fix: add the same onPress !== undefined guard to the macOS focusable check.

2. AccessibilityInfo.js  align macOS noop carve-outs with upstream's 0.83 android-first guard structure

Upstream 0.83 restructured two methods  isBoldTextEnabled (line 100) and isReduceTransparencyEnabled (line 335)  from:

if (Platform.OS === 'ios') { /* iOS native call */ } else { return Promise.resolve(false); }

to:

if (Platform.OS === 'android') { return Promise.resolve(false); } else { /* iOS native call */ }

(android-first guard). The fork's [macOS] blocks preserved the OLD if (ios) shape, which on macOS happens to land in the else branch and currently produces correct (noop) behavior. But this is structurally fragile:

- A future Apple platform reporting a non-'ios'/non-'macos' Platform.OS would silently fall into the macOS else branch (currently fine since it's a noop, but a foot-gun if someone changes the else body).
- The fork's diff against upstream is larger than necessary — every future merge will have to wrestle with this shape mismatch.

Fix: align with upstream's android-first guard, adding macos explicitly to the noop branch as an || Platform.OS === 'macos' /* [macOS] */ inline clause. Single-line diff against upstream; easy for future merges.

Together, these close the audit item for "Audit upstream breaking changes" on the Road to 0.83 tracking issue (#2901). The audit covered 9 fork-patched JS files; 7 were clean (ViewNativeComponent, ReactNativeStyleAttributes, ScrollView,
ScrollViewStickyHeader, TextInput, ImageInjection, ImageTypes) and 2 had the issues fixed here.

Test Plan

- TouchableBounce focusable: code review  the macOS guard mirrors upstream's exactly, in the same precedence inside the [macOS]/macOS] block.
- AccessibilityInfo.isBoldTextEnabled / isReduceTransparencyEnabled on macOS: both still return Promise.resolve(false) (verified by reading the new guard  Platform.OS === 'macos' matches the early-return).
- iOS unchanged: same native call, same error message, same Promise shape.
- Flow types: no signature changes; type-check is unaffected.

Related

- #2901  Road to 0.83 tracking issue (closes the "Audit upstream breaking changes" item alongside the earlier audit comment noting P1-P4 already absorbed by the merge).
- Audit also flagged a third candidate (TextInput.js:90,92 RCTSingelineTextInputNativeComponent typo'd require path), but verification showed both the file AND the require are consistently misspelled the same way — quirky, not broken.
Out of scope.

@tvinhas tvinhas requested a review from a team as a code owner May 13, 2026 23:43
@tvinhas
Copy link
Copy Markdown
Author

tvinhas commented May 17, 2026

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant