A whitespace is automatically added if caret is at leftmost and I press a key, browser is Android Webview #7098

Open
opened 2024-05-20 19:48:28 +02:00 by marijnh · 1 comment
marijnh commented 2024-05-20 19:48:28 +02:00 (Migrated from gitlab.com)

Hello
I am using codemirror version 5.56.16
Inside Android webView I am running a HTML file with CodeMirror for syntax highlighting.
There is a bug,
when the caret is at leftmost of a new line, and I press a key (for example letter A), the letter I pressed is added to the textarea but then a whitespace is also automatically added at the line, and if I press a backspace when the caret is at leftmost of a new line, a whitespace is also automatically added and I cant erase the line.
This issue only happened inside Android webView, didn't happen inside chrome and other browsers.
I tried setting smartIndent to false but the issue wasn't resolved.
here is my initialization code:

editor = CodeMirror.fromTextArea(document.getElementById("code"), {
				  mode : language,
				  autoRefresh: true,
				  lineWrapping: true,
				  lineNumbers: true,
				  theme: theme
				});
Hello I am using codemirror version 5.56.16 Inside Android webView I am running a HTML file with CodeMirror for syntax highlighting. There is a bug, when the caret is at leftmost of a new line, and I press a key (for example letter A), the letter I pressed is added to the textarea but then a whitespace is also automatically added at the line, and if I press a backspace when the caret is at leftmost of a new line, a whitespace is also automatically added and I cant erase the line. This issue only happened inside Android webView, didn't happen inside chrome and other browsers. I tried setting smartIndent to false but the issue wasn't resolved. here is my initialization code: ``` editor = CodeMirror.fromTextArea(document.getElementById("code"), { mode : language, autoRefresh: true, lineWrapping: true, lineNumbers: true, theme: theme }); ```
marijnh commented 2024-11-01 03:50:51 +01:00 (Migrated from gitlab.com)

I met the same issue like yours,the difference is the project use the version 6.x and build by Vue3,but runnning good in the version 5.x and vue2

I met the same issue like yours,the difference is the project use the version 6.x and build by Vue3,but runnning good in the version 5.x and vue2
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#7098
No description provided.