Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove condition for history merge on null prev selection #3914

Merged
merged 3 commits into from
Feb 17, 2023

Conversation

acywatson
Copy link
Contributor

@acywatson acywatson commented Feb 15, 2023

This appears to fix the undo functionality in situations where the editorState is initialized with a Selection. Previously, the first entry would be discarded, rather than merged (since prevSelection was non-null) leading historyState.current to still be empty, meaning the first actual change to the content would not be placed onto the undo stack.

Fixes #3912

@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 Feb 15, 2023
@vercel
Copy link

vercel bot commented Feb 15, 2023

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

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 16, 2023 at 3:49PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 16, 2023 at 3:49PM (UTC)

@github-actions
Copy link

github-actions bot commented Feb 15, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 25.97 KB (0%) 520 ms (0%) 81 ms (+140.54% 🔺) 600 ms
packages/lexical-rich-text/dist/LexicalRichText.js 36.71 KB (0%) 735 ms (0%) 63 ms (+164.77% 🔺) 797 ms
packages/lexical-plain-text/dist/LexicalPlainText.js 36.69 KB (0%) 734 ms (0%) 76 ms (+85.7% 🔺) 810 ms

@thegreatercurve thegreatercurve merged commit dfb0383 into main Feb 17, 2023
@fantactuka fantactuka deleted the fix-undo branch July 6, 2023 20:09
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.

Bug: undo button not enabled if only one change has been made
3 participants