Skip to content

Commit

Permalink
fastmail#472 fixed contenteditable=false elements being merged when t…
Browse files Browse the repository at this point in the history
…hey shouldn't, fixed compilation error caused by missing nullcheck
  • Loading branch information
Alexander Gratzl committed Nov 29, 2024
1 parent bb795b0 commit 2293b4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ class Squire {
break;
}

if (!(child as HTMLElement).isContentEditable) {
if (child && !(child as HTMLElement).isContentEditable) {
replaceWith(child, document.createTextNode('') as Text);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion source/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const areAlike = (
return (
node.nodeName !== 'A' &&
node.className === node2.className &&
node.style.cssText === node2.style.cssText
node.style.cssText === node2.style.cssText &&
(node as HTMLElement).isContentEditable && (node2 as HTMLElement).isContentEditable
);
}
return true;
Expand Down

0 comments on commit 2293b4a

Please sign in to comment.