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

Retain format on programatic updates #5707

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Retain format on programatic updates #5707

wants to merge 5 commits into from

Conversation

zurfyx
Copy link
Member

@zurfyx zurfyx commented Mar 13, 2024

Follow up on #5692

Screen.Recording.2024-03-12.at.2.37.16.PM.mov

Closes #5620

Potential follow up #5708

@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 Mar 13, 2024
Copy link

vercel bot commented Mar 13, 2024

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 Mar 13, 2024 8:43pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2024 8:43pm

Copy link

github-actions bot commented Mar 13, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 26.75 KB (0%) 536 ms (0%) 39 ms (+253.99% 🔺) 574 ms
packages/lexical-rich-text/dist/LexicalRichText.js 38.89 KB (+0.06% 🔺) 778 ms (+0.06% 🔺) 74 ms (+110.49% 🔺) 852 ms
packages/lexical-plain-text/dist/LexicalPlainText.js 38.86 KB (+0.06% 🔺) 778 ms (+0.06% 🔺) 68 ms (+92.86% 🔺) 845 ms

@@ -286,6 +286,8 @@ function onSelectionChange(
}
}

const previousSelection = editor._editorState._selection;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivailop7 to use $getPreviousSelection I'd have to do .getEditorState.read, do you think it's worth it, particularly when this is run at every single selection change?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, can skip.

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.

How to keep formatting between lines?
3 participants