diff options
| author | Antoine Guenet <age@odoo.com> | 2019-07-11 13:20:28 +0000 |
|---|---|---|
| committer | Antoine Guenet <age@odoo.com> | 2019-07-11 14:41:12 +0000 |
| commit | e7828c362718b40ed74920a1ce3619766fa84ff2 (patch) | |
| tree | c4f28eef1283ac74126f2c8682208a78ae678567 /addons/web_editor/static/src/js | |
| parent | 5b41b5c563c75e18f4cf8d2f7dd66d5e273e4341 (diff) | |
[FIX] web_editor: properly insert character in empty nested list
Fix a bug that can be reproduced like so:
- Insert list
- Type char
- ENTER
- TAB
- Type char
The character gets inserted _after_ the `br` instead of replacing it.
closes odoo/odoo#34805
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/plugin/helper.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js b/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js index a025d6a0082..1738e6e7b48 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/helper.js @@ -1885,6 +1885,9 @@ var HelperPlugin = AbstractPlugin.extend({ // Create empty text node to have a range into the node if (range.sc.tagName && !dom.isVoid(range.sc) && !range.sc.childNodes[range.so]) { $(range.sc).append(invisible); + if (invisible.previousSibling && invisible.previousSibling.tagName === "BR") { + invisible.previousSibling.remove(); + } range = this.context.invoke('editor.setRange', invisible, 0); } |
