compose-menu icon indicating copy to clipboard operation
compose-menu copied to clipboard

TextField is out of sync with typed text on Mobile Web

Open Ronjar opened this issue 8 months ago • 16 comments

Text field writes text, I didn't write. Same for back button.

Device: Xiaomi Android device.

https://github.com/user-attachments/assets/8c704fef-110e-4883-b6b3-e26eb46b116e

Ronjar avatar May 13 '25 18:05 Ronjar

Thanks for the report. I was able to reproduce it on my end on the Android Emulator. Seems to be an issue with soft keyboard on Compose Web.

Investigating.

alexstyl avatar May 13 '25 19:05 alexstyl

@Ronjar what Android version are you using?

alexstyl avatar May 13 '25 19:05 alexstyl

I observe this too, in Edge on Android 13

Radiokot avatar May 16 '25 06:05 Radiokot

Can you folks try out one more time and tell me if the issue is still there?

https://composables.com/docs/compose-unstyled/textfield

alexstyl avatar Aug 24 '25 04:08 alexstyl

Hi Alex,

Now it works better in Edge on Android, but the field is still acting weird. Whenever you or the keyboard try to select something in it, it starts overwriting and duplicating the selection, which also not really visible.

On the following video, I try to select the word "fit" but it changes it to "character", then duplication continues. When I try to use the "Selection erase" action on my keyboard (Heliboard) which selects some content before the cursor and then erases it, the field also duplicates the selection.

Radiokot avatar Aug 24 '25 06:08 Radiokot

https://dl3.pushbulletusercontent.com/dPPAz6LPEmV3oDVVLNdC1Igf10bJsQKY/Screen_Recording_20250824_092554_Edge.mp4

Radiokot avatar Aug 24 '25 06:08 Radiokot

Can you folks check one more time? Can't seem to be able to repro but that's on the Android Emulator API 36

https://composables.com/docs/compose-unstyled/textfield

alexstyl avatar Nov 03 '25 07:11 alexstyl

Hey Alex,

The field is still unusable. With Samsung keyboard, whatever you type gets duplicated unless you only click suggestions. With Heliboard keyboard, whatever you select or move your cursor to gets duplicated. Videos attached.

https://github.com/user-attachments/assets/a01c92cd-a80a-42c3-84f8-3e15e9d9db6e https://github.com/user-attachments/assets/8e94dcfb-be14-4241-a24a-527801384b30

Radiokot avatar Nov 03 '25 07:11 Radiokot

Is there any chance you could try with GBoard? I am trying to pinpoint what the cause is here

alexstyl avatar Nov 03 '25 08:11 alexstyl

No duplication bugs with GBoard 👀

Radiokot avatar Nov 03 '25 08:11 Radiokot

that's interesting. it's in my todo to deploy a simple app with a BasicTextField so that you folks can check if the issue still remains.

I don't believe this is an issue with Unstyled but it's worth figuring out what is causing this so that we let the related Compose team know and fix it.

alexstyl avatar Nov 03 '25 14:11 alexstyl

I tried typing on different keyboards in the Kotlin Conf app search bar – there are no duplications https://jetbrains.github.io/kotlinconf-app/#Main

Radiokot avatar Nov 03 '25 14:11 Radiokot

great find. thanks for sharing

alexstyl avatar Nov 03 '25 15:11 alexstyl

I have just updated the demo. could you try one more time? https://composables.com/docs/compose-unstyled/textfield

the new demo has no background btw.

alexstyl avatar Nov 05 '25 14:11 alexstyl

Hi Alex, the field is now usable with Samsung keyboard, no duplication. With Heliboard, the issue remains – text duplicates when moving cursor (trying to select something).

Radiokot avatar Nov 05 '25 14:11 Radiokot

Thanks for checking. Seems like the demo on the site was out of date and wasn't using the stateful version of TextField.

Need to check what's the difference with the KotlinConf app

alexstyl avatar Nov 05 '25 15:11 alexstyl