Skip to content

Commit

Permalink
[FIX] web_editor: inserting icon it replaces another
Browse files Browse the repository at this point in the history
Before this commit:

-On inserting icon in note, it replaces another icon.It occurs because
`isEmpty(block)` returns true, when block element was font-awesome, which
causes the code in `insert` method to remove current node, resulting in removal
of previous icon.

After this commit:

-Now icon is added without replacing the another icon.

task-3482264

closes #152929

X-original-commit: 9a94877
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
  • Loading branch information
shsa-odoo authored and Zynton committed Feb 15, 2024
1 parent ffda905 commit 56666f8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ export function isEmptyBlock(blockEl) {
if (!blockEl || blockEl.nodeType !== Node.ELEMENT_NODE) {
return false;
}
if (visibleCharRegex.test(blockEl.textContent)) {
if (isFontAwesome(blockEl) || visibleCharRegex.test(blockEl.textContent)) {
return false;
}
if (blockEl.querySelectorAll('br').length >= 2) {
Expand Down

0 comments on commit 56666f8

Please sign in to comment.