Skip to content

Commit

Permalink
fastmail#472 when inserting an element, correctly place range positio…
Browse files Browse the repository at this point in the history
…n AFTER contenteditable=false element instead of inside
  • Loading branch information
Alexander Gratzl committed Nov 29, 2024
1 parent 0388bcb commit bb795b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/range/Boundaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ const moveRangeBoundariesUpTree = (
}

range.setStart(startContainer, startOffset);

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

range.setEnd(endContainer, endOffset);
};

Expand Down

0 comments on commit bb795b0

Please sign in to comment.