JiHong88 / suneditor

Pure javascript based WYSIWYG html editor, with no dependencies.
http://suneditor.com
MIT License
1.67k stars 308 forks source link

Enter- Key does not insert <br> #955

Open hhfiddelke opened 2 years ago

hhfiddelke commented 2 years ago

First of all i have to say thank you for this marvellous tool.

I currently try to create an Controll- Addin, where the current version of the editor is part of Windows- form that allows to use a JavScript as control.

I got this working until the point, where i press the Enter-key (Numpad or Normal) in the textarea. I would expect, that pressing Enter inserts a new Line in the text, but nothing happens. Because i do not have a JavaScript console available, i inserted some different logging.

Until now I found out that the Enter-Key fires a KeyDown- event with expected!? values and that pressing CTRL+M creates the NewLine as expected.

What am i able to do, to find out where the problem occurs?

I also have to say that i am not a JavaScript- native,😥 so i would need perhaps some more explanation.

JiHong88 commented 2 years ago

Please tell me more detail. I do not understand well. 😢

hhfiddelke commented 2 years ago

As i wrote above, i have a windows form that includes your editor as javacript crontol-addin.

SunEditor is initialized by the attached script. When the form is shown as in the picture, all works fine except the ENTER-key. When i use Suneditor in a WEB-page, ENTER inserts a
, but not here, where only Ctrl+M or Shift+ENTER insert a
!?

So as i don't think that is a real bug in the editor, i need a hint where to grab some information why ENTER is not working.

Script_js.txt editor

JiHong88 commented 2 years ago

https://github.com/JiHong88/SunEditor/blob/master/src/lib/core.js#L6763 The operation when entering the Enter key (key code 13) is performed here.

PS: "lang(In nodejs)": "de" This is not a real option. you don't have to