froala / wysiwyg-editor

The next generation Javascript WYSIWYG HTML Editor.
https://www.froala.com/wysiwyg-editor
Other
5.29k stars 672 forks source link

Failed to execute 'selectNode' on 'Range' error when saving edits made using TUI Advanced Image Editor #3785

Open philipstratford opened 4 years ago

philipstratford commented 4 years ago
Expected behavior.

Edits to images should save without errors.

Actual behavior.

When the Save button is clicked in the TUI Image Editor window, the browser dev tools console shows the error: Uncaught DOMException: Failed to execute 'selectNode' on 'Range': the given Node has no parent.

Steps to reproduce the problem.

I haven't created a fiddle because you can see the problem very easily on your own example page here: https://www.froala.com/wysiwyg-editor/examples/tui-advanced-image-editor

  1. Click on the image in the WYSIWYG editor.
  2. Select the Advanced Edit option.
  3. In the TUI Image Editor window, click the Save button.

Look in the browser's dev tools console and note the error described above.

Editor version.

3.0.6

OS.

Windows 10 v1809

Browser.

Chrome (latest production version - 79.0.3945.88)

dejanmartinovic commented 4 years ago

@philipstratford This is probably an issue with the website. The error you mentioned doesn't occur in jsFiddle: https://jsfiddle.net/dejan_m/Lnwgab58/ In that demo, you can invoke the same error replacing the image without opening the TUI

philipstratford commented 4 years ago

I get the same error in my application but you're right, the error does seem to be in the image.min.js file, not image_tui.min.js. Like you, I get the same error when I use the 'Replace' function for an image in my application's Froala editor too.