[FIX] web_editor: fix unlink when nested tag
Whenever there was a tag inside a link (e.g.`<a href="..."><b>link</b></a>`), it was impossible to unlink. closes odoo/odoo#81112 X-original-commit: a7f2027c6131309b239026b4e1299a6f396171dd Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -416,8 +416,8 @@ export const editorCommands = {
|
||||
// we need to remove the contentEditable isolation of links
|
||||
// before we apply the unlink, otherwise the command is not performed
|
||||
// because the content editable root is the link
|
||||
const closestEl = closestElement(sel.focusNode);
|
||||
if (closestEl.tagName === 'A' && closestEl.getAttribute('contenteditable') === 'true') {
|
||||
const closestEl = closestElement(sel.focusNode, 'a');
|
||||
if (closestEl && closestEl.getAttribute('contenteditable') === 'true') {
|
||||
editor._activateContenteditable();
|
||||
}
|
||||
if (sel.isCollapsed) {
|
||||
|
||||
Reference in New Issue
Block a user