https://kotlinlang.org logo
#compose
Title
# compose
e

eygraber

02/22/2023, 9:41 PM
I'm using a
FocusRequester
to provide focus to a
TextField
and open the keyboard when a screen opens using this code:
Copy code
remember { FocusRequester() }.apply {
    LaunchedEffect(Unit) {
      requestFocus()
    }
}
This works fine, except on API 27 where the keyboard doesn't show. Is this a known issue?
c

Chris Fillmore

02/23/2023, 12:28 AM
Only on 27? What about 26 or 28?
e

eygraber

02/23/2023, 12:41 AM
As far as I can tell just 27. I'm gonna test again later
c

Chris Fillmore

02/23/2023, 12:42 AM
Try adding a delay of 300 ms and see if it works
e

eygraber

02/23/2023, 12:48 AM
I'll try that, thanks
That seems to do the trick, thanks!
c

Chris Fillmore

03/07/2023, 4:46 PM
Yeah it’s a bit of a hack, but I have something similar in my app. It works around some keyboard issues
7 Views