[lexical-playground] Bug Fix: avoid node selection on CardNode drag release - #9135
Merged
etrepum merged 2 commits intoSep 8, 2026
Merged
Conversation
kavyansh18
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
September 8, 2026 12:33
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
hey @etrepum can you please review the PR |
etrepum
reviewed
Sep 8, 2026
Use: Use the latest editor state when resolving the chrome target to match the DOM state at event time. Co-authored-by: Bob Ippolito <bob@redivi.com>
Contributor
Author
|
Thanks for the review @etrepum . Applied the suggested change to use the latest editor state. |
etrepum
approved these changes
Sep 8, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When selecting text inside an editable slot of a
CardNode, releasing the mouse over the node's chrome area could incorrectly trigger aNodeSelectionfor the entire card.This happened because
registerHostChromeSelectionhandled themousedownand subsequentCLICK_COMMANDindependently. It checked only the target of the click, so a click synthesized after dragging from a slot to the card chrome could be interpreted as an intentional click on the host node.This PR fixes the issue by tracking the host node on which the
mousedownstarted and only promoting that node to aNodeSelectionwhen the subsequent click corresponds to the same host.Changes
NodeKeywhen a mousedown occurs on host chrome.NodeSelection.Closes #9115
Test plan
Before
The new regression test was run against the unpatched implementation.
The test failed as expected because releasing over the card chrome incorrectly promoted the card to a
NodeSelection:This reproduces the behavior described in #9115.
After
After applying the fix:
The regression test also verifies that an intentional mousedown + click on the host chrome still correctly creates a NodeSelection.