Skip to content

Conversation

@Senasiko
Copy link
Contributor

Description

This PR fixs an issue where, when the selection is collapsed, $toggleLink only affects the nearest TextNode

Before

before.mp4

After

after.mp4

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 12, 2026
@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Feb 13, 2026 3:10am
lexical-playground Ready Ready Preview, Comment Feb 13, 2026 3:10am

Request Review

Comment on lines 688 to 693
if (selection.isCollapsed()) {
parentLink.getChildren().forEach((child) => {
parentLink.insertBefore(child);
});
parentLink.remove();
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would probably be better to handle this outside of the nodes.forEach loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this change, please review again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants