I can't figure out a good way to set focus to the ...
# compose-desktop
a
I can't figure out a good way to set focus to the current content control when switching to a different tab in a tab widget. If I call
focusRequester.requestFocus()
in the tab click event, I think the new content isn't yet on screen so focus requester doesn't work I tried using
LaunchedEffect
but I get a warning that it shouldn't be performed during the composition (which makes sense)
a
Using requestFocus in LaunchedEffect is very standard. Not sure why you’re getting a warning.
a
Ah, thank you, there was a mistake in my code