java.lang.IllegalStateException: FocusRequester is not initialized. One reason for this is that you requesting focus changes during composition. Focus requesters should not be made during composition, but should be made in response to some event.
which just gives you an error without message, but declaring the variable outside works I just saw 🙈
👌 1
l
Landerl Young
03/05/2021, 10:14 AM
The onClick lambda is not @Composable, while LocalFocusManager.current is query Composition Local, which requires a compose context.
BTW, this code should not compile…
error message:
@Composable invocations can only happen from the context of a @Composable function
👌 1
👍 1
s
Syex
03/05/2021, 10:16 AM
I got this 😄
l
Landerl Young
03/05/2021, 10:18 AM
Lol, me too, on the IDE, but command line gives the correct one.