Skip to content

Fix insertText outdated selection after node replacement - #5954

Merged
zurfyx merged 4 commits into
mainfrom
insertText-1234
Apr 24, 2024
Merged

zurfyx merged 4 commits into
mainfrom
insertText-1234

Conversation

@zurfyx

@zurfyx zurfyx commented Apr 24, 2024 •

Copy link
Copy Markdown
Member

This is bad and need a follow up.

The fact that we provide an API for cloning the selection means that the selection can be cloned at any time and it's impossible to tell when the current selection reference is relevant.

In this case, there were occurences during clipboard HTML paste and split point inside insertNodes that were relying on the outdated selection.

@facebook-github-bot facebook-github-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 Apr 24, 2024
@vercel

vercel Bot commented Apr 24, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2024 2:55pm
lexical-playground 🛑 Canceled (Inspect) Apr 24, 2024 2:55pm

@github-actions

github-actions Bot commented Apr 24, 2024 •

Copy link
Copy Markdown

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 23.65 KB (0%) 474 ms (0%) 245 ms (+325.16% 🔺) 718 ms
packages/lexical-rich-text/dist/LexicalRichText.js 33.85 KB (0%) 677 ms (0%) 348 ms (+131.49% 🔺) 1.1 s
packages/lexical-plain-text/dist/LexicalPlainText.js 33.79 KB (0%) 676 ms (0%) 274 ms (+73.36% 🔺) 950 ms

@zurfyx
zurfyx marked this pull request as ready for review April 24, 2024 14:52
@zurfyx zurfyx changed the title WIP Fix insertText outdated selection after node replacement Fix insertText outdated selection after node replacement Apr 24, 2024

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 132ad53f Deployed Apr 24, 2024 by vercel[bot]
Preview – lexical — 132ad53f Deployed Apr 24, 2024 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants