codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.94k stars 376 forks source link

Android Webview: Text changes when cursor is moved #1456

Closed patienttruth closed 6 days ago

patienttruth commented 1 month ago

Describe the issue

Sometime in the last few months I can no longer use the code editor in Home Assistant. I've learned HA uses this project, so after checking issues I'm reporting.

When I move the cursor in a snippet of code it appears to insert text in other parts of the body.

https://github.com/user-attachments/assets/ecb5be0f-6721-4d18-8395-3bef58c2f4dd

This seems isolated to Chromium browsers, Firefox works normally. I've tried the following:

Vanadium 130.0.6723.58 Home Assistant App - version 2024.9.4-full Brave 1.70.126, Chromium 129.0.6668.100

Android 14; Pixel 6 Build/AP2A.240905.003.F1

Also reported on the Home Assistant repo.

Browser and platform

No response

Reproduction link

No response

marijnh commented 1 month ago

What virtual keyboard are you using? And does this happen in stock Chrome as well?

patienttruth commented 1 month ago

What virtual keyboard are you using? And does this happen in stock Chrome as well?

I've tested 3 virtual keyboards today.

Normally I use Gboard, and it did work earlier in the year. I think even a ~3 months ago.

The first two have the problem. Hacker's keyboard does not (just realizing this as I downloaded it midway through troubleshooting).

I just tested a fresh install of standard Chrome and it has the same problem.

marijnh commented 1 month ago

The editor in the video seems to behave very differently from what I see when I try to reproduce this. How are you moving the cursor? With regular taps?

patienttruth commented 6 days ago

The editor in the video seems to behave very differently from what I see when I try to reproduce this. How are you moving the cursor? With regular taps?

Missed your reply somehow.

Yes, regular taps.

Oddly, just noticed that in Home Assistant the editor under automations works normally, but dashboards has this problem. I'd assume they're using CodeMirror in both cases, but something must be different about how it's implemented.

marijnh commented 6 days ago

I don't debug editors embedded in other people's products. If you can reproduce the issue in a plain CodeMirror setup, in a regular browser, I can take a look. But until then, I'm going to close this.

patienttruth commented 6 days ago

I don't debug editors embedded in other people's products. If you can reproduce the issue in a plain CodeMirror setup, in a regular browser, I can take a look. But until then, I'm going to close this.

Understandable. I only mentioned that detail hoping it was helpful.

While the original video may have been in Vanadium browser, I did test the same website (does that count as a "plain CodeMirror setup"?) with a fresh install of Google Chrome and it had the same thing happening.

Edit - just realizing that all Chromium browsers on this phone are using the Graphene OS version of Webview, so not "plain". Looks like it might be on that end. Thanks! I'll post back if I have anything else useful.