Help.... Doubts about Focus (TextInput) "User-St...
# compose
i
Help.... Doubts about Focus (TextInput) "User-Story": 1. As a user, When I click the textbox, it should get focus, and open IME 2. As a user, While textbox focused, When I click outside the textbox (against anywhere in screen window), Focus should RELEASED from the textbox. and IME needs to closed. a. If the outside click-ed element is also clickable in its own behaviour, It should not get execute its own callback until the focus is released, i. (Once the focus released, User needs to again click the same element to execute its own callback) For the User-Story-2, Is there any direct approach to achieve this??? (apart from registering a "onClickInterceptor" at the whole screen level).
2
h
Cc @Alex Vanyo
a
What platform and input device are you working with here? I recently merged a fix for "clear focus on click" behavior for a specific case of mice and touchpad pointer events on Android The standard way to do the blocking input for everything else is a scrim of some sort - like what you will find on a dialog or sheet
i
Android with system keyboard only. (NO external input device)
l
I've been searching and testing quite a bit today. Best I've found or done so far is to release focus on any tap, with focus reattaching if it's a focus able element. That means the keyboard closes/open of you click again on the same text input. I'd love to get a better behavior without having to attach code to every single click able or focus able element but that seems to be compose kryotonite...