in compose desktop i have the strange issue that a...
# compose-desktop
z
in compose desktop i have the strange issue that a
TextField
recevies keyboard input even when its not visible on screen. what can i do? my guess is that it has something to do with
focusRequester
. but still if the textfield is not rendered/composed it should not do anything like that
z
If the field is focused then it doesn’t matter if it’s visible or not, that’s intentional. Compose doesn’t release focus just because the focus target is scrolled out of view. What it should do though is scroll back into view when the input occurs, so if that’s not happening then it might be a bug.
s
Just to complement @Zach Klippenstein (he/him) [MOD]'s response, you might also be falling in the trap overlaying something on top of the
TextField
. I once did navigation between screens like that, never removing the hidden screens from composition, and faced the same issue. So yeah, make sure that it's either not focused or is not composed at all.
z
its not scrolling out of view and its not overlaying with something. its
Copy code
if (something){
  TextField()
} else {
  Row() # no textfield here
}
s
oh, now that's interesting since we're taking about desktop, how do you know that the text field still receive input?
z
because emoji popup pops up when i type. and also when i press "enter" the app tries to send a message and fails. because no chat partner ist selected
s
Huh, interesting. You might wanna make a minimal reproducer and open an issue on YouTrack (and link to it here)
z
And please post a link here when you’ve filed. Sounds like the host state isn’t updating correctly when the input session is cancelled.
☝️ 1