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

Adjust selection after triple click #4512

Merged
merged 1 commit into from
May 18, 2023
Merged

Adjust selection after triple click #4512

merged 1 commit into from
May 18, 2023

Conversation

fantactuka
Copy link
Contributor

Triple click expands selection to cover whole element, but also moves focus node to the next element sibling. So even though visually it looks like single text block is selected, selection is also expanded to the next line. If we try to modify such selection two blocks are affected.

Easiest way to reproduce: have two paragraphs, tripple click on first, convert into heading, then both paragraphs will be converted into headings. Another example is tripple click within table cell, and pressing delete: it selects current cell and beginning of the next one. Hitting delete will completely delete one of the cells

Before:

Screen.Recording.2023-05-17.at.5.52.23.PM.mov

After:

Screen.Recording.2023-05-17.at.5.54.29.PM.mov

@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 May 17, 2023
@vercel
Copy link

vercel bot commented May 17, 2023

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

Name Status Preview Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview May 17, 2023 9:55pm
lexical-playground ✅ Ready (Inspect) Visit Preview May 17, 2023 9:55pm

@github-actions
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 27.25 KB (+0.15% 🔺) 545 ms (+0.15% 🔺) 443 ms (-11.32% 🔽) 988 ms
packages/lexical-rich-text/dist/LexicalRichText.js 38.2 KB (+0.11% 🔺) 764 ms (+0.11% 🔺) 410 ms (+19.08% 🔺) 1.2 s
packages/lexical-plain-text/dist/LexicalPlainText.js 38.17 KB (+0.12% 🔺) 764 ms (+0.12% 🔺) 741 ms (+36.61% 🔺) 1.6 s

Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

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

Uh, nice! This one has been there forever. Doesn't close any issue?

@fantactuka
Copy link
Contributor Author

fantactuka commented May 17, 2023

Fixes #2648, #2660 and #3784

@fantactuka fantactuka merged commit c0e7e78 into main May 18, 2023
@fantactuka fantactuka deleted the triple-click branch May 18, 2023 20:27
vuamitom pushed a commit to bitbriks/lexical that referenced this pull request May 19, 2023
@LuciNyan
Copy link
Contributor

Incredible!

This was referenced May 23, 2023
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