JiHong88 / suneditor

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

Editor doesn't recognize image as change if uploaded at line end #1479

Open last-resort opened 2 weeks ago

last-resort commented 2 weeks ago

Describe the bug If you upload a picture at the end of a line it isn't recognized as a change (save button is still disabled). It doesn't matter if you use the toolbar button, drag and drop or copy paste, the result is always the same. If you upload it between some text content everything works as expected.

To Reproduce Steps to reproduce the behavior:

  1. Go to http://suneditor.com/sample/index.html
  2. Place the cursor right behind the dot in "Pasting from Microsoft Word and Excel."
  3. The save button should be still disabled
  4. Upload an image by clicking the image button in the toolbar or paste/drag and drop to this position
  5. No change is detected, the save button is still disabled

Expected behavior The change should be recognized and you should be able to save the editor content after uploading the image.

Desktop (please complete the following information):

Additional context As i said it works if you place the cursor within the line content and not at the end. For example if you place the image between the words Microsoft and Word the change is recognized and the save button enabled.