Skip to content

[lexical-clipboard] Fix: copy correct selection when editor in different window/document - #7822

Merged
etrepum merged 1 commit into
meta:mainfrom
james-atticus:lexical-clipboard-headless
Sep 17, 2025
Merged

etrepum merged 1 commit into
meta:mainfrom
james-atticus:lexical-clipboard-headless

Conversation

@james-atticus

Copy link
Copy Markdown
Contributor

Description

When the editor is mounted in a different window, for example when using react-new-window, then copyToClipboard copies the selection from the main window.

Test plan

Tried to get a repro working with unit tests but couldn't get selection working with JSDOM.

Before

Copy using context menu gets the text from the parent window's selection:

Screen.Recording.2025-09-17.at.1.48.34.pm.mov

After

Screen.Recording.2025-09-17.at.1.56.39.pm.mov

@vercel

vercel Bot commented Sep 17, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Sep 17, 2025 4:02am
lexical-playground Ready Ready Preview Comment Sep 17, 2025 4:02am

@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 17, 2025
@ivailop7 ivailop7 added the extended-tests Run extended e2e tests on a PR label Sep 17, 2025
@etrepum

etrepum commented Sep 17, 2025

Copy link
Copy Markdown
Collaborator

#7790 probably fixes some more of these issues

@etrepum

etrepum commented Sep 17, 2025

Copy link
Copy Markdown
Collaborator

(or at least something like #7790, that someone is interested in actually finishing)

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — abbb7a57 Deployed Sep 17, 2025 by vercel[bot]
Preview – lexical — abbb7a57 Deployed Sep 17, 2025 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.

3 participants