Skip to content

fix(0.81, macos): three Fabric focus regressions (blur, sendAccessibilityEvent, VirtualView)#3016

Merged
Saadnajmi merged 2 commits into
microsoft:0.81-stablefrom
Saadnajmi:0.81/saadnajmi/macos-fabric-focus-regressions
Jul 8, 2026
Merged

fix(0.81, macos): three Fabric focus regressions (blur, sendAccessibilityEvent, VirtualView)#3016
Saadnajmi merged 2 commits into
microsoft:0.81-stablefrom
Saadnajmi:0.81/saadnajmi/macos-fabric-focus-regressions

Conversation

@Saadnajmi

Copy link
Copy Markdown
Collaborator

Summary

Backport of #3015 to 0.81-stable.

Three macOS-only Fabric focus / first-responder regressions:

  1. RCTViewComponentView.blur() — was a no-op (resignFirstResponder on NSWindow doesn't clear the focused subview). Now clears via makeFirstResponder:nil, guarded on self.
  2. Fabric setAccessibilityFocus — the macOS branch was empty; added makeFirstResponder: + NSAccessibilityFocusedUIElementChangedNotification.
  3. RCTVirtualViewComponentView — added acceptsFirstResponder / accessibilityHitTest: hooks so keyboard/VoiceOver navigation unhides flagged-offscreen views.

All changes are macOS-gated; iOS/visionOS behavior is unchanged.

Test Plan

Same as #3015 — builds clean (RNTester-macOS, BUILD SUCCEEDED); every change is inside a #if TARGET_OS_OSX / #else branch.

Credit

Original work by @tvinhas in #2959 (commit cherry-picked to retain authorship). Supersedes #2959.

Co-authored-by: Thiago Vinhas thiago@vinhas.net

tvinhas and others added 2 commits July 8, 2026 08:47
Follow-up refinements on top of Thiago Vinhas's original fix:
- RCTViewComponentView.blur(): only clear the window's first responder
  when this view actually holds it (guard on == self), matching iOS
  [self resignFirstResponder] semantics and avoiding stealing focus
  from an unrelated view.
- Trim the verbose inline comments from all three changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Saadnajmi Saadnajmi requested a review from a team as a code owner July 8, 2026 15:48
@Saadnajmi Saadnajmi merged commit 5779558 into microsoft:0.81-stable Jul 8, 2026
24 checks passed
@Saadnajmi Saadnajmi deleted the 0.81/saadnajmi/macos-fabric-focus-regressions branch July 8, 2026 17:09
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.

3 participants