Skip to content

[lexical] Bug Fix: Avoid redundant selection change command - #9163

Merged
etrepum merged 2 commits into
facebook:mainfrom
levensta:fix-issue-8885
Sep 13, 2026
Merged

etrepum merged 2 commits into
facebook:mainfrom
levensta:fix-issue-8885

Conversation

@levensta

Copy link
Copy Markdown
Contributor

Description

This PR is based on the patch from #9138

Explicit conditions have been added for the SELECTION_CHANGE_COMMAND dispatcher to prevent false triggers, such as when a user interacts with the interface outside the editor (for example, by clicking a link in a floating toolbar).

Closes #8885

Test plan

Before

Safari generates a selectionchange event when you click on buttons that contain text, and the lexical dispatcher dispatches SELECTION_CHANGE_COMMAND

safari-selectionchange.mov

After

Changing the selection on text outside the editor no longer triggers SELECTION_CHANGE_COMMAND. A browser test has been added

Screen.Recording.2026-09-13.at.02.54.37.mov

@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 Sep 13, 2026
@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 13, 2026 12:27am UTC
lexical-playground Ready Ready Preview Sep 13, 2026 12:27am UTC

Request Review

@levensta levensta changed the title Bug Fix: Avoid redundant selection change command [lexical] Bug Fix: Avoid redundant selection change command Sep 13, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Sep 13, 2026
its-Sohan

This comment was marked as low quality.

@etrepum
etrepum added this pull request to the merge queue Sep 13, 2026
Merged via the queue into facebook:main with commit e77523b Sep 13, 2026
54 checks passed
@etrepum etrepum mentioned this pull request Sep 17, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical d0f9eb66 Deployed Sep 13, 2026 by vercel[bot]
Preview – lexical-playground d0f9eb66 Deployed Sep 13, 2026 by vercel[bot]
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. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: SELECTION_CHANGE_COMMAND is triggered after clicking a link in Safari

4 participants