Skip to content

Commit

Permalink
Merge branch 'github_master' into solvistas_master
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gratzl committed Jan 10, 2025
2 parents 3349029 + 2773a26 commit bb4cf58
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/range/Boundaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,13 @@ const moveRangeBoundariesUpTree = (

range.setStart(startContainer, startOffset);

if (startContainer instanceof HTMLElement && !startContainer.isContentEditable) {
range.setStart(endContainer, endOffset);
let node = startContainer;
while (isInline(node)) {
if (node instanceof HTMLElement && !node.isContentEditable) {
range.setStart(endContainer, endOffset);
break;
}
node = node.parentNode!;
}

range.setEnd(endContainer, endOffset);
Expand Down

0 comments on commit bb4cf58

Please sign in to comment.