summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields
diff options
context:
space:
mode:
authorPriyanka Kakadiya <pka@odoo.com>2019-05-27 12:33:51 +0000
committerMohammed Shekha <msh@openerp.com>2019-06-03 05:36:08 +0000
commit0799742d053354dfa8a0c7e28d1eaba8a205956a (patch)
treebb828db90f50bc57e695389e07c5f9df8a12be60 /addons/web/static/tests/fields
parent37ab5a700912cd8de1cdf4310502e341d007ad53 (diff)
[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 execute `setEnd` on `Range`, that error is thrown because editable DIV doesn't save old range 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. After this commit, editable div will use newly created range for the element for ex: -> content: test -> selected content "test" when click on link dialog: ec: test , eo: 4, sc: test, so: 0 selected content -> start 0, end 4 -> "test" like this after clicking on discard: ec: null text element, eo: 4, sc: null text element, so: 0 selected content -> ec and sc both are null, so it will throw an error while setting cursor position after applying fix when click on discard: ec: test, eo: 4, sc: test, so: 0 selected content -> start 0, end 4 -> "test" task - 1955863 closes odoo/odoo#33692 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web/static/tests/fields')
0 files changed, 0 insertions, 0 deletions