A framework for building native applications using React
Defer focus until attached (#54309)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
E
Eric Rozell committed
9d498f676d96b1c8d3d6c58dc188ea51e88e3474
Parent: da5f15a
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com>
on 10/29/2025, 6:56:02 PM