I remember there were versions of Compose where wh...
# compose
p
I remember there were versions of Compose where when clicked outside of text field it loosing its focus. Now I'm using Compose of version 1.11.0-rc01 and it is not loosing focus when click outside. Is there any settings to enable this behaviour?
a
Which platform are you testing on?
p
Desktop and Web
e
Seems similar to CMP-10127 Opening a Popup with focusable = false incorrectly clears Compose focus from the parent container https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.11.0-rc01 Could you please try setting
isClearFocusOnMouseDownEnabled
flag
true
and check?
p
It helps only for Desktop and Web (on desktop) platform. For Web on Android it is not loosing focus. May be because on Android there is Tap not Click event... @Ekaterina Zaitseva Should i create an issue for it?
e
It's expected, this flag is only for mouse/trackpad events, not for touches cc @Alexander Maryanovsky
a
1. There’s a flag that controls this in CMP:
ComposeUiFlags.isClearFocusOnMouseDownEnabled
2. On Android it’s controlled by
(LocalView.current.parent as AbstractComposeView).autoClearFocusBehavior
. 3. The functionality only applies to mouse (and trackpad), not touch. 4. The flag was on by default for several 1.11 beta versions in CMP but we decided to set it to off by default for 1.11-rc 5. It may go back to on by default in 1.12, we’re discussing it (with Alex 🙂 among others).
p
I'm using ``ComposeUiFlags.isClearFocusOnMouseDownEnabled=true`` for Web target (not Android target), but when launching app in browser on mobile device this flag has no effect.
a
Are you using touch on the mobile device?
p
yes
a
3. The functionality only applies to mouse (and trackpad), not touch.
p
I understand that. But should it be like this?
a
It’s by design. Whether it will remain like this going forward, we’re discussing it with Google…
👌 1