html-editor-enhanced icon indicating copy to clipboard operation
html-editor-enhanced copied to clipboard

New line not created immediately and cursor is still in same position.

Open akmichael opened this issue 4 years ago • 13 comments

Environment tested : Oneplus 6, android

steps to reproduce: focus at the end of the line, and press enter (return key) multiple times. cursor was still in same position. but gettext returns value with new lines.

akmichael avatar Jun 17 '21 13:06 akmichael

After testing this extensively this is unfortunately just an issue with Android. Here are the details:

Summernote editor uses a property called keyCode to detect what was pressed. The key code for "enter" is 13, and when it sees that keycode, it adds the newline accordingly and moves the cursor down. The issue on Android is that before any key code it will always send "229" when autocorrect settings are activated on the keyboard. Sometimes right after 229 it will send "13" so the cursor changes the position, but a lot of the time it will not send "13". Thus the new line is not created. If you test with all autocorrect turned off, it works flawlessly every time.

I don't know if there is a workaround, I am trying to figure something out. Created https://github.com/summernote/summernote/issues/4074 to see if anyone has any ideas.

tneotia avatar Jun 17 '21 22:06 tneotia

Same issue here, would love to get some help.

boinxi avatar Jun 20 '21 20:06 boinxi

I have same problem

svoza10 avatar Jun 29 '21 10:06 svoza10

Are there any updates? This seems like a nice package but this bug is a not use this package in production type bug. Thank you!

boinxi avatar Jul 02 '21 11:07 boinxi

@boinxi really sorry don't have anything new... I tried to mess around with the summernote JS the other day and couldn't get it to work. The only solution at the moment is to disable autocorrect on the keyboard, I don't know if you can do this through flutter. I also checked earlier if it was possible through the WebView but didn't find anything.

tneotia avatar Jul 02 '21 13:07 tneotia

I think I may have to ditch summernote to fix some of the deeper issues and I'm also considering creating a fully native editor (with less features) using extended_text_field, but I don't know if it will be possible quite yet.

tneotia avatar Jul 02 '21 13:07 tneotia

Thanks @tneotia . I hope it will go well eventually, flutter lacks a good rich text editor at the moment. wish you well!

boinxi avatar Jul 08 '21 11:07 boinxi

Are there any updates? This package is the one that fit perfectly for my project. I'd like to get some help.

AERM2018 avatar Mar 21 '23 17:03 AERM2018

I also faced the same issue on Android 10 before, but only with GBoard keyboard. Moreover, the problem existed in Summernote, Jodit, and Quill web versions (tested via Chrome mobile).

But now for some reason everything seems to be working fine!

Alspb avatar Apr 10 '23 23:04 Alspb

I face the same problem, and btw it is unstable. Sometimes it is present and sometimes not, with the same build (debug mode).

html_editor_enhanced: 2.5.1 device: android galaxy s9+

olegyablokov avatar Apr 29 '23 19:04 olegyablokov

@olegyablokov, is it with GBoard only, or with other keyboards too?

Alspb avatar May 01 '23 21:05 Alspb

@Alspb tested only on GBoard.

olegyablokov avatar May 03 '23 08:05 olegyablokov

Update: can't reproduce the bug with GBoard on Android 10 emulator and Android 13 smartphone, but the problem remains on Android 13 emulator.

Alspb avatar Jul 02 '23 09:07 Alspb