Skip to content

Commit

Permalink
fastmail#472 fixed bug where deletion of selected text was no longer …
Browse files Browse the repository at this point in the history
…possible due to startContainer.isContentEditable being undefined on text nodes
  • Loading branch information
Alexander Gratzl committed Jan 9, 2025
1 parent 819960f commit d59fff8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const areAlike = (
node.nodeName !== 'A' &&
node.className === node2.className &&
node.style.cssText === node2.style.cssText &&
(node as HTMLElement).isContentEditable &&
(node2 as HTMLElement).isContentEditable
node.isContentEditable &&
node2.isContentEditable
);
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion source/range/Boundaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const moveRangeBoundariesUpTree = (

range.setStart(startContainer, startOffset);

if (!(startContainer as HTMLElement).isContentEditable) {
if (startContainer instanceof HTMLElement && !startContainer.isContentEditable) {
range.setStart(endContainer, endOffset);
}

Expand Down

0 comments on commit d59fff8

Please sign in to comment.