Hi :wave: I have a screen with a `BasicTextField` ...
# compose
n
Hi 👋 I have a screen with a
BasicTextField
and I want to use a
BackHandler
to go out of it. However, if the text field has focus, the first "back" press is caught by the field to unfocus itself. Only the second one will invoke the back handler. Is there any way around this?
a
n
Were you able to fix it? A workaround I found is to use Modifier.onKeyEvent
a
Not really I still have that bug in my app
i
FWIW, it is expected on Android that views / composables that handle key events take precedence over `onBackPressed()`/`BackHandler`. If you're seeing
TextField
handle focus / the back key differently from an Android's
EditText
, it would still be worth filing an issue to get that fixed: https://issuetracker.google.com/issues/new?component=612128
f
same issue here 😞 If i go to one screen and fast click on back the BackHandler doesn't work
d
did anyone file an issue on this?
n
Not me
j
I did a quick comparison with a View based screen I’ve just recreated with compose. In the View-based one: 1. the first back press both hides the keyboard and removes focus from the text field 2. the second triggers back nav. In the compose-based one: 1. the first press hides the keyboard 2. the seconds removes the focus 3. the third triggers back nav.
👍 1
👍🏻 1
@Ian Lake ☝️ Is it worth filing a bug then?
@dimsuz are you in the process or shall I?
d
I'm not, please go ahead! Post the link here for us to star it 🙂
👌 3
i
If it doesn't match Views, then yes, you should file a bug
j
This bug was fixed very quickly. Hopefully it will make it for rc02 (if it hasn’t already been cut). Thanks everyone for your involvement.
n
Very sad to hear that this fix won’t be available on 1.0 😞
d
Likewise; this has arisen late as a major issue for UI/UX in our App; now faced with a difficult decision whether to adopt a Compose Alpha build.
Confirmed that Compose
1.1.0-alpha04
fixes the behaviour in line with View's
EditText
- have to wonder how this major difference in behaviour made it into release.
It would help with planning around this, to know when is the intended release date for 
1.1.0
?