Skip to content

Emit tvOS focus events after focus updates - #58372

Closed
sbuggay wants to merge 1 commit into
react:mainfrom
sbuggay:export-D119054149
Closed

Emit tvOS focus events after focus updates#58372
sbuggay wants to merge 1 commit into
react:mainfrom
sbuggay:export-D119054149

Conversation

@sbuggay

@sbuggay sbuggay commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary:
On tvOS, the focus engine and UIKit first responder are related but distinct. The imperative focus path previously called becomeFirstResponder before requesting a focus-engine update. If tvOS rejected that candidate, React Native had already emitted blur for the currently focused view and focus for the candidate, leaving JavaScript event state out of sync with visual focus.

Request the tvOS focus update without changing first responder first. didUpdateFocusInContext remains the point that promotes the selected view to first responder and emits events. Successful focus updates retain their focus and blur events, rejected updates emit neither, and non-tvOS behavior is unchanged.

Changelog:
[iOS][Fixed] - Prevent unsuccessful tvOS focus requests from emitting stale focus events

Differential Revision: D119054149

Summary:
On tvOS, the focus engine and UIKit first responder are related but distinct. The imperative focus path previously called `becomeFirstResponder` before requesting a focus-engine update. If tvOS rejected that candidate, React Native had already emitted `blur` for the currently focused view and `focus` for the candidate, leaving JavaScript event state out of sync with visual focus.

Request the tvOS focus update without changing first responder first. `didUpdateFocusInContext` remains the point that promotes the selected view to first responder and emits events. Successful focus updates retain their focus and blur events, rejected updates emit neither, and non-tvOS behavior is unchanged.

Changelog:
[iOS][Fixed] - Prevent unsuccessful tvOS focus requests from emitting stale focus events

Differential Revision: D119054149
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 7, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Sep 7, 2026
@meta-codesync

meta-codesync Bot commented Sep 7, 2026

Copy link
Copy Markdown

@sbuggay has exported this pull request. If you are a Meta employee, you can view the originating Diff in D119054149.

@meta-codesync

meta-codesync Bot commented Sep 7, 2026

Copy link
Copy Markdown

This pull request has been merged in 3e897cf.

@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant