Skip to content

Commit

Permalink
Fix #5720 wrong __size value cause the reconcile child event to crash…
Browse files Browse the repository at this point in the history
… on image drag
  • Loading branch information
Sahejkm committed Apr 1, 2024
1 parent c365b3d commit a82a7f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lexical/src/LexicalReconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ function reconcileChildren(
nextElement,
prevChildren,
nextChildren,
prevChildren.length,
nextChildren.length,
prevChildrenSize,
nextChildrenSize,
dom,
);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/lexical/src/LexicalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,10 @@ function internalResolveSelectionPoint(
return null;
}
if ($isElementNode(resolvedElement)) {
resolvedOffset = Math.min(
resolvedElement.getChildrenSize(),
resolvedOffset,
);
let child = resolvedElement.getChildAtIndex(resolvedOffset);
if (
$isElementNode(child) &&
Expand Down

0 comments on commit a82a7f4

Please sign in to comment.