Skip to content

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

Closed
Thiago Vinhas (tvinhas) wants to merge 1 commit into
microsoft:0.83-mergefrom
tvinhas:fix-macos-js-layer-0.83-three-way-merge-audit
Closed

fix(macos): align TouchableBounce focusable + AccessibilityInfo guards with upstream 0.83#2964
Thiago Vinhas (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

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}Thefork'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
newonPress!==undefinedguard.EffectonmacOS: aTouchableBouncewithoutanonPresspropisstillTab-focusable/VoiceOver-reachable,eventhoughithasnointeraction.Decorativewrapperswronglygrabkeyboardfocus.Fix: addthesameonPress!==undefinedguardtothemacOSfocusablecheck.2.AccessibilityInfo.jsalignmacOSnoopcarve-outswithupstream's 0.83 android-first guard structure
Upstream0.83restructuredtwomethodsisBoldTextEnabled(line100)andisReduceTransparencyEnabled(line335)from:
if(Platform.OS==='ios'){/* iOS native call */}else{returnPromise.resolve(false);}
to:
if(Platform.OS==='android'){returnPromise.resolve(false);}else{/* iOS native call */}(android-firstguard).Thefork'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:
-AfutureAppleplatformreportinganon-'ios'/non-'macos'Platform.OSwouldsilentlyfallintothemacOSelsebranch(currentlyfinesinceit's a noop, but a foot-gun if someone changes the else body).
-Thefork's diff against upstream is larger than necessary — every future merge will have to wrestle with this shape mismatch.
Fix: alignwithupstream'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,theseclosetheaudititemfor"Audit upstream breaking changes"ontheRoadto0.83trackingissue(#2901).Theauditcovered9fork-patchedJSfiles;7wereclean(ViewNativeComponent,ReactNativeStyleAttributes,ScrollView,ScrollViewStickyHeader,TextInput,ImageInjection,ImageTypes)and2hadtheissuesfixedhere.TestPlan-TouchableBouncefocusable: codereviewthemacOSguardmirrorsupstream's exactly, in the same precedence inside the [macOS]/macOS] block.
-AccessibilityInfo.isBoldTextEnabled/isReduceTransparencyEnabledonmacOS: bothstillreturnPromise.resolve(false)(verifiedbyreadingthenewguardPlatform.OS==='macos'matchestheearly-return).-iOSunchanged: samenativecall,sameerrormessage,samePromiseshape.-Flowtypes: nosignaturechanges;type-checkisunaffected.Related- #2901Roadto0.83trackingissue(closesthe"Audit upstream breaking changes"itemalongsidetheearlierauditcommentnotingP1-P4alreadyabsorbedbythemerge).-Auditalsoflaggedathirdcandidate(TextInput.js:90,92RCTSingelineTextInputNativeComponenttypo'd require path), but verification showed both the file AND the require are consistently misspelled the same way — quirky, not broken.
Outofscope.

@tvinhas
Thiago Vinhas (tvinhas) requested a review from a team as a code ownerMay 13, 2026 23:43
@tvinhas

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Christopher Wallace (christopherwxyz) added a commit to officialunofficial/react-native-macos that referenced this pull request Jun 6, 2026
…crosoft#2957microsoft#2959microsoft#2963microsoft#2964)
Finishes the 0.83 stabilization on uno/desktop-0.85: codegen npmPackageName
constant, hermes-utils static_h/main branch selection by RCT_HERMES_V1_ENABLED,
three Fabric focus regressions (blur/sendAccessibilityEvent/VirtualView),
React-RCTUIKit.podspec in package files, TouchableBounce focusable +
AccessibilityInfo guards. RNTester-macOS unit tests remain green.
Saad Najmi (Saadnajmi) added a commit to Saadnajmi/react-native-macos that referenced this pull request Jul 7, 2026
…s with upstream 0.83
TouchableBounce: add the `onPress !== undefined` guard to the macOS
`focusable` check so decorative (onPress-less) TouchableBounce views are
no longer Tab-focusable / VoiceOver-reachable, matching upstream 0.83.
AccessibilityInfo: remove the macOS carve-outs in `isBoldTextEnabled` and
`isReduceTransparencyEnabled` and restore upstream's android-first guard,
so macOS falls through to the native `NativeAccessibilityManagerApple`
call like its siblings (`isReduceMotionEnabled`, `isInvertColorsEnabled`):
- `isReduceTransparencyEnabled` now reports the real macOS "Reduce
Transparency" setting. The native `_isReduceTransparencyEnabled` ivar is
already initialized and live-updated on macOS (RCTAccessibilityManager),
so the previous hardcoded `Promise.resolve(false)` was silently
discarding a working native value.
- `isBoldTextEnabled` still resolves `false` on macOS (the native ivar is
never set on macOS), but now with zero macOS-specific fork divergence.
Supersedes microsoft#2964 (original author unreachable). Closes the "Audit upstream
breaking changes" item on the Road to 0.83 tracking issue (microsoft#2901).
Co-authored-by: Thiago Vinhas <thiago@vinhas.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Saadnajmi

Copy link
Copy Markdown
Collaborator

Superseded by #3009

Saad Najmi (Saadnajmi) added a commit that referenced this pull request Jul 7, 2026
…3009)
## Summary
Supersedes #2964. Two small JS fixes from the 0.83 merge audit.
**`TouchableBounce.js`** — add the `onPress !== undefined` guard to the
macOS `focusable` check (matches upstream 0.83). A `TouchableBounce`
with no `onPress` is no longer Tab/VoiceOver focusable.
**`AccessibilityInfo.js`** — drop the macOS carve-outs in
`isBoldTextEnabled` and `isReduceTransparencyEnabled` so both use
upstream's android-first guard and fall through to native on macOS, like
their siblings (`isReduceMotionEnabled`, `isInvertColorsEnabled`):
- `isReduceTransparencyEnabled` now returns the real macOS "Reduce
Transparency" setting instead of a hardcoded `false` — the native side
already tracks and live-updates it.
- `isBoldTextEnabled` still returns `false` on macOS (no native value),
now with zero fork divergence.
Both methods now match upstream exactly, aside from the fork-wide
`NativeAccessibilityManagerApple` rename.
## Test plan
- macOS: `isReduceTransparencyEnabled` reflects the System Settings
toggle; `isBoldTextEnabled` stays `false`.
- `TouchableBounce` without `onPress` is not focusable.
- iOS / Android unchanged; no type changes.
Related: #2901.
Co-authored-by: Thiago Vinhas <thiago@vinhas.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Saad Najmi (Saadnajmi) added a commit that referenced this pull request Jul 13, 2026
…3009)
## Summary
Supersedes #2964. Two small JS fixes from the 0.83 merge audit.
**`TouchableBounce.js`** — add the `onPress !== undefined` guard to the
macOS `focusable` check (matches upstream 0.83). A `TouchableBounce`
with no `onPress` is no longer Tab/VoiceOver focusable.
**`AccessibilityInfo.js`** — drop the macOS carve-outs in
`isBoldTextEnabled` and `isReduceTransparencyEnabled` so both use
upstream's android-first guard and fall through to native on macOS, like
their siblings (`isReduceMotionEnabled`, `isInvertColorsEnabled`):
- `isReduceTransparencyEnabled` now returns the real macOS "Reduce
Transparency" setting instead of a hardcoded `false` — the native side
already tracks and live-updates it.
- `isBoldTextEnabled` still returns `false` on macOS (no native value),
now with zero fork divergence.
Both methods now match upstream exactly, aside from the fork-wide
`NativeAccessibilityManagerApple` rename.
## Test plan
- macOS: `isReduceTransparencyEnabled` reflects the System Settings
toggle; `isBoldTextEnabled` stays `false`.
- `TouchableBounce` without `onPress` is not focusable.
- iOS / Android unchanged; no type changes.
Related: #2901.
Co-authored-by: Thiago Vinhas <thiago@vinhas.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto 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.

2 participants

@tvinhas@Saadnajmi