Manuel Unterhofer05/08/2023, 7:39 AM
but I am worried that this would not reliably happen within the same frame because the coroutine behind
might be scheduled too late?
Loney Chou05/08/2023, 8:46 AM
(experimental), and most of the time you would use the former. A FocusRequester needs to know where it is in order to search for a focusable target, and this is done during the composition phase (when updating the
). Considering not causing any weird issue, using
should be the safest and fastest way, because they get executed right after the composition is ready (if I remember correctly).
for it right. It gets executed on the spot, unlike
which will somehow "schedule" the execution, it depends.
Manuel Unterhofer05/08/2023, 9:25 AM
has keys. That should solve it, thanks!
Zach Klippenstein (he/him) [MOD]05/15/2023, 11:19 PM
should work as well. The coroutines are scheduled at the same time as `DisposableEffect`s are ran, and so they will always be dispatched before the next frame’s input handling phase (which is the first thing the choreographer does)