Skip to content

Commit

Permalink
Do not delete entity when backspace from next table (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong authored Jun 30, 2023
1 parent cf85be5 commit 59a5f5d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,16 @@ function cacheGetNeighborEntityElement(
return null;
}

const regions = editor.getSelectedRegions();
const regionRoot = regions[0]?.rootNode;

range.commonAncestorContainer.normalize();
const pos = Position.getEnd(range).normalize();
const isAtBeginOrEnd = pos.offset == 0 || pos.isAtEnd;
let entityNode: HTMLElement | null = null;

if (isAtBeginOrEnd) {
const traverser = editor.getBodyTraverser(pos.node);
if (isAtBeginOrEnd && regionRoot) {
const traverser = ContentTraverser.createBodyTraverser(regionRoot, pos.node);
const sibling = isNext
? pos.offset == 0
? traverser.currentInlineElement
Expand Down

0 comments on commit 59a5f5d

Please sign in to comment.