Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: delete horizontal node in table cell node #6598

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/lexical/src/LexicalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,14 @@ export class RangeSelection implements BaseSelection {
if (this.forwardDeletion(anchor, anchorNode, isBackward)) {
return;
}

if (
isBackward &&
anchor.offset === 0 &&
$isElementNode(anchorNode) &&
$isDecoratorNode(anchorNode.getFirstChild())
Comment on lines +1709 to +1710
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the best solution is probably $isRootOrShadowRoot(anchorNode)? It would be nice to add a test and maybe a comment around here to describe what we're trying to do here

) {
return;
}
// Handle the deletion around decorators.
const focus = this.focus;
const possibleNode = $getAdjacentNode(focus, isBackward);
Expand Down
Loading