Skip to content

Commit

Permalink
Fix selecting table selects an image after (facebook#5917)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatsiarynaDzibrova authored Apr 22, 2024
1 parent 73ddf84 commit bba84b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/lexical-table/src/LexicalTableSelectionHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,7 @@ export function applyTableHandlers(
if (isFocusInside) {
newSelection.focus.set(
tableNode.getParentOrThrow().getKey(),
isBackward
? tableNode.getIndexWithinParent()
: tableNode.getIndexWithinParent() + 1,
tableNode.getIndexWithinParent(),
'element',
);
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical/src/LexicalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1940,13 +1940,13 @@ function internalResolveSelectionPoint(
: child.getFirstDescendant();
if (descendant === null) {
resolvedElement = child;
resolvedOffset = 0;
} else {
child = descendant;
resolvedElement = $isElementNode(child)
? child
: child.getParentOrThrow();
}
resolvedOffset = 0;
}
if ($isTextNode(child)) {
resolvedNode = child;
Expand Down

0 comments on commit bba84b9

Please sign in to comment.