https://kotlinlang.org logo
b

bruno.aybar

09/02/2020, 2:41 PM
Hello. I've been seen weird issues when dealing with TextFields. Basically, the touch area for every component is incorrect after the soft keyboard has been opened. (attaching video on the thread). I can easily reproduce in these scenarios: • having a list of textfields, and select on one that has to be moved by to display the keyboard. Touch is now not working as expected • having a textfield aligned at bottom, open keyboard. For this case, I checked Jetchat app to see how that's handled, because I'm not seeing the issue there. However, I'm also seeing that there, ScrollState is used (I haven't check what that exactly does, but I guess it's handling scroll manually?) I wonder if that is a known issue, a bug, or an expected behavior in which scroll has to be handled manually?
and here's another one with the TextField at bottom (noticed how I clicked somewhere else in the screen, and the TextField gets focused) :
m

Michał Jurczyk

09/02/2020, 2:43 PM
Are you using
LazyColumn
or native UI
RecyclerView
? I had this issue when I tried to put
Composables
into a Recycler 🤔
b

bruno.aybar

09/02/2020, 2:43 PM
I'm able to reproduce that behavior with ScrollableColumn, LazyColumn, and Stack w/ TextField at bottom
a

Adam Powell

09/02/2020, 2:43 PM
We have a few known issues around this sort of thing, they're being worked on
🙌 4
b

bruno.aybar

09/02/2020, 2:44 PM
That's great news, thanks Adam!
t

Timo Drick

09/02/2020, 2:44 PM
Can you try to encapsulate your list item with key(item) { .... } sometimes this helps
b

bruno.aybar

09/02/2020, 2:46 PM
@Timo Drick does not seem to collections, but rather anytime the soft keyboard is opened and the contents have to be moved up to focus the TextField
a

Adam Powell

09/02/2020, 2:47 PM
the issues we're tracking are around how touch event offsets are tracked during
adjustPan
IME handling.
Some internal bookkeeping isn't being updated as expected
👍 1
In the meantime,
adjustPan
isn't often what you want unless it's a floating dialog window, and compose isn't wiring up the autodetection of scrolling containers in the view hierarchy yet that usually changes the default to
adjustResize
if you have a RecyclerView or ScrollView
You can probably sidestep this issue by setting
adjustResize
explicitly on your activity tag in your manifest
b

bruno.aybar

09/02/2020, 2:51 PM
I tried that too, as I saw that's done in Jetchat app, however did not worked for me 😅
I also tested doing it the old way, using a RelativeLayout with TextField at bottom, and in that case it works for me using
adjustPan
and
adjustResize
taking my preview comment back,
adjustResize
seems to do the trick with TextField at bottom.
👍 1
a

Adam Powell

09/02/2020, 3:03 PM
cool, thanks for helping confirm that it's the same issue we're tracking 🙂
👍 3
💪 1
a

Alexander Karkossa

10/14/2020, 8:47 AM
@Adam Powell Could u tell us about your known issues with these types of problems? Ar all fixed and released with alpha05? 😅
3 Views