diff --git a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js index bb00041704a1276bdc13775dd5fd72edc00e91db..e895cae603e4b7b58017efb890271ed868a71e53 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js @@ -1513,7 +1513,8 @@ export class OdooEditor extends EventTarget { doJoin && next && !(next.previousSibling && next.previousSibling === joinWith) && - this.editable.contains(next) + this.editable.contains(next) && + closestElement(joinWith, "TD") === closestElement(next, "TD") ) { const restore = preserveCursor(this.document); this.observerFlush(); diff --git a/addons/web_editor/static/lib/odoo-editor/test/spec/editor.test.js b/addons/web_editor/static/lib/odoo-editor/test/spec/editor.test.js index 53e632a2df92bb83dac6eca695ab460318336c76..f7b86faff6c98568cf81b09c05b988025c7df6b3 100644 --- a/addons/web_editor/static/lib/odoo-editor/test/spec/editor.test.js +++ b/addons/web_editor/static/lib/odoo-editor/test/spec/editor.test.js @@ -924,6 +924,27 @@ X[] ), }); }); + it('should delete the list item', async () => { + await testEditor(BasicEditor, { + contentBefore: unformat( + `<table><tbody> + <tr> + <td><ul><li>[a</li><li>b</li><li>c]</li></ul></td> + <td><ul><li>A</li><li>B</li><li>C</li></ul></td> + </tr> + </tbody></table>`, + ), + stepFunction: deleteForward, + contentAfter: unformat( + `<table><tbody> + <tr> + <td><ul><li>[]<br></li></ul></td> + <td><ul><li>A</li><li>B</li><li>C</li></ul></td> + </tr> + </tbody></table>`, + ), + }); + }); it('should delete an image that is displayed as a block', async () => { await testEditor(BasicEditor, { contentBefore: unformat(`<div>a[b<img style="display: block;"/>c]d</div>`),