Commit 3e897cf
Emit tvOS focus events after focus updates (#58372)
Summary:
Pull Request resolved: #58372
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
Reviewed By: AnastasiaRainMaker
Differential Revision: D119054149
fbshipit-source-id: 71f1fa4f60f46146baf8adaeafd104e041b4bc8c1 parent 96518a8 commit 3e897cf
1 file changed
Lines changed: 2 additions & 1 deletion
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1850 | 1850 | | |
1851 | 1851 | | |
1852 | 1852 | | |
1853 | | - | |
1854 | 1853 | | |
1855 | 1854 | | |
1856 | 1855 | | |
| |||
1861 | 1860 | | |
1862 | 1861 | | |
1863 | 1862 | | |
| 1863 | + | |
| 1864 | + | |
1864 | 1865 | | |
1865 | 1866 | | |
1866 | 1867 | | |
| |||
0 commit comments