code-input icon indicating copy to clipboard operation
code-input copied to clipboard

Repeated type on key input on Android device using a Bluetooth keyboard

Open aryoxp opened this issue 1 year ago • 6 comments

When I type using a Bluetooth keyboard on an Android device, every time I press a character on keyboard, which I had previously typed before, is reappearing on code-input editor area.

In the following screenshot on the demo page CodePen, on line 8 of the editor, I press the 'a' key, then 'b', 'c', 'd', and 'e'. The expected output on the editor should be 'abcde', however, I got 'aababcabcdabcde'. The previously typed letter reappear on the editor.

Screenshot_20241220_135849_Chrome

This is not happening when I used the on-screen keyboard of the tablet device. My device is Samsung Galaxy Tab S8, Android 14, Google Chrome web browser. The Bluetooth keyboard I was using is Logitech Keys-To-Go-2; the same device, browser, and keyboard that I used to type this report. I don't have other Bluetooth external keyboard, so I don't know whether the problem is on the keyboard incompatibility or a bug in the code-input key detection/sync.

Any suggestion to this issue is appreciated. Thank you.

aryoxp avatar Dec 20 '24 07:12 aryoxp

Thanks for the detailed description, Aryo. I think this might be similar to bug #117. Please could you let me know what behaviour you get when you do the same with this demo?

WebCoder49 avatar Dec 20 '24 10:12 WebCoder49

Yes, it is the same with the demo.

Screenshot_20241220_174933_Chrome

aryoxp avatar Dec 20 '24 10:12 aryoxp

Thanks for the quick reply. I will let you know when I have changes ready for you to test/actions to test.

WebCoder49 avatar Dec 20 '24 12:12 WebCoder49

I just realised I sent you the wrong demo, @aryoxp. Please could you try out this one (without the indent plugin which may be affecting the behaviour) and let me know what behaviour you get?

Also, it would be helpful if you could try out both this demo and the previous one on all browsers you have on the Android tablet as well as Mozilla Firefox, since it uses a different rendering engine to Chrome so may act differently. Thanks!

WebCoder49 avatar Dec 24 '24 17:12 WebCoder49

sorry for the late reply, in Chrome, the behaviour is still the same. Screenshot_20241229_165105_Chrome

in Firefox, the behaviour is even weirder, some characters only appear once, but duplicating the rest uncontrollably. Screenshot_20241229_165817_Firefox

in the above screenshot, I typed: 'abcde', 'qwert', 'asdfg', and 'zxcvb', one on each line., however, it seems that the [Enter] key is not repeating.

aryoxp avatar Dec 29 '24 10:12 aryoxp

For your information, I'm very busy right now until 21 June. I can't implement new feature requests or bugfixes myself in projects I maintain, but can merge contributions by others, especially if they fix bugs. I've therefore unassigned this from myself for now.

WebCoder49 avatar May 10 '25 11:05 WebCoder49

@aryoxp I'm back from the busy period now (although under a different username right now - as my bio states I managed to lock myself out of 2FA but am regaining access); I hope you're having a great 2025.

I've (finally) got another demo for you to test: https://oliver.geer.im/tmp/2025-06-20.html (alternatively, the let-textareas-do-their-job branch of this repository). Please could you try these 4 code-inputs first and let me know if they work with the Bluetooth keyboard? If they do work, please could you then try out https://oliver.geer.im/tmp/code-input.let-textareas-do-their-job/tests/hljs.html and https://oliver.geer.im/tmp/code-input.let-textareas-do-their-job/tests/prism.html and let me know the results? (if one fails, please reload since sometimes resources aren't loaded quickly enough the first time until they're cached for the second ☹ - I should fix this). I'm afraid I can't test this myself which is why I've given you so many tasks (and one of the reasons I've taken so long).

I do notice this looks quite dodgy which is why I will note that the oliver.geer.im domain has been listed on my actual account for a while.

WebCoder49-temp avatar Jun 20 '25 19:06 WebCoder49-temp

I can verify the above message is legitimate.

WebCoder49 avatar Jun 22 '25 10:06 WebCoder49

@aryoxp I should have notified you above. Please could you test as described above?

WebCoder49 avatar Jul 06 '25 15:07 WebCoder49

I believe this is fixed after #149, and can be tested with the code in the main branch right now or in the next release.

WebCoder49 avatar Jul 25 '25 12:07 WebCoder49