codemirror / dev

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

Gboard doesn't delete text in Firefox #1380

Open Iron16Bit opened 6 months ago

Iron16Bit commented 6 months ago

Describe the issue

I was able to reproduce the bug both on Android 14 and in Android 6. When trying to delete text in a CodeMirror 6 editor using Gboard in Firefox, text isn't deleted. This doesn't happen neither using another keyboard (CodeBoard) nor in Chrome.

The error can be repoduced by copying the content of this repo on an Android device and hosting it through a simple http server. The content of the repo are a set of slides made for ICP

Trying to delete using Gboard in Firefox:

https://github.com/codemirror/dev/assets/92951307/ac025c05-b3d0-49f0-8ded-035c29430247

Trying to delete using CodeBoard in Firefox:

https://github.com/codemirror/dev/assets/92951307/b43182dc-62bd-4388-880e-1546052a56a9

Trying to delete using Gboard in chrome:

https://github.com/codemirror/dev/assets/92951307/34a2cd8d-692a-4782-a450-59beb103c9de

Browser and platform

Android Firefox

Reproduction link

No response

marijnh commented 6 months ago

That repository doesn't show me how you're using the editor. Try to set up something much simpler on https://codemirror.net/try and I can take a look. Trying this in a simple minimal demo doesn't reproduce the issue you describe.

Iron16Bit commented 6 months ago

Unfortunately I wasn't able to reproduce it using the suggested playground. Might this be related to hosting from local storage?

By locally hosting a much simpler project and trying to delete the text, only in Firefox and using Gboard it happened that it also deleted text on the right of the text cursor.

As for the project from the videos, this is the whole repo, but in particular this is the general container of the editor

marijnh commented 6 months ago

Using halfway current versions of the CodeMirror packages might help.

Iron16Bit commented 6 months ago

Sorry, it was just a repo I quickly found online. Yet, plese refer to the last sentence talking about the repo with the project from the videos. That still is CodeMirror 6.0.1

marijnh commented 6 months ago

The package lock seems to use @codemirror/view 6.6, which is from 2022

Iron16Bit commented 6 months ago

Updating it did not work. On the other hand, I noticed the problem might be on my end. Some of the editors are managed using Workers while others using SharedWorkers, seems like the problem only happens with the first category

Iron16Bit commented 6 months ago

A quick update: I tried to recreate a minimal environment using CodeMirror and a WebWorker but there were no problems. I then tried to use Svelte and CodeMirror, but still no problems. I'm at a loss, I'm not sure what is causing the problem in the original repo