You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Pull Request resolved: #54309
We can encounter cases where something is rendered by React but not yet attached to Android at the point focus is called.
If we defer focus until the View is attached to the window, we can avoid apps needing to add annoying timeouts or other creative mechanisms to wait for native mount before calling imperative focus.
The only caveat here is that if you call imperative focus on something offscreen initially that is attached later (e.g., due to clipping), apps could encounter undesirable bugs where focus jumps at the point the previously detached view is now attached. One might also argue it's bug prone to call focus on something that is far offscreen / you don't plan to mount onscreen immediately.
## Changelog
[Android][Fixed] Defers focus until View is attached
Reviewed By: sbuggay
Differential Revision: D85727424
fbshipit-source-id: 677834aa2d9ba2d3247d1e71b3fe0cdd9a6ec4aa
0 commit comments