Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] web_editor: restoreRange on invalid node
In a web editor, add some text, select the text, add a link and immediately discard the link modal. Traceback. The traceback is a DOM `IndexSizeError`, that error is thrown when the boundaries of a DOM Range (`document.createRange`) are outside of the ranged elements. In this context, the error happens because the element is empty and the range has an end bound set to the size of the selected text. Odoo wrap code does some text node split in order to attach the link just on the selected text. If it correctly re-set the underlying structure, it does not update the $(editable) structure used to restore ranges. opw-1981751 closes odoo#33257 Signed-off-by: Julien Castiaux <[email protected]>
- Loading branch information