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

Override selectall on RangeSelection #4671

Merged
merged 2 commits into from
Jun 16, 2023
Merged

Override selectall on RangeSelection #4671

merged 2 commits into from
Jun 16, 2023

Conversation

zurfyx
Copy link
Member

@zurfyx zurfyx commented Jun 16, 2023

See issue description. Given that it works well on FF, I've decided not to overide FF's behavior for now. Safari's behavior is sometimes worse than Chrome, caret jumping around instead of selecting so Chrome + Safari are a must-do override.

I didn't narrow down to checking whether there's DecoratorNodes at its boundaries because the root cause seems to be contenteditable=false but it doesn't necessarily have to sit at the top

<div contenteditable="true"><div contenteditable="false">...</div></div>

^ This will not work on Chrome

Might be that the pattern is first line of descendants not contenteditable (given the correct valid Nodes that can take this properties (i.e. iframe can't take it)) but since I'm not too confident on what the pattern is and the logic might be overly complicated, I'm overriding them all.

Fixes #4670

@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 Jun 16, 2023
@vercel
Copy link

vercel bot commented Jun 16, 2023

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

Name Status Preview Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview Jun 16, 2023 3:05pm
lexical-playground ✅ Ready (Inspect) Visit Preview Jun 16, 2023 3:05pm

@github-actions
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 27.95 KB (+0.16% 🔺) 560 ms (+0.16% 🔺) 195 ms (+81.08% 🔺) 754 ms
packages/lexical-rich-text/dist/LexicalRichText.js 38.98 KB (+0.14% 🔺) 780 ms (+0.14% 🔺) 150 ms (+12.67% 🔺) 930 ms
packages/lexical-plain-text/dist/LexicalPlainText.js 38.95 KB (+0.14% 🔺) 780 ms (+0.14% 🔺) 195 ms (+49.77% 🔺) 974 ms

@zurfyx zurfyx merged commit d23d1fd into main Jun 16, 2023
44 of 45 checks passed
@fantactuka fantactuka deleted the fix-selection2 branch July 6, 2023 20:15
@zurfyx zurfyx mentioned this pull request Jul 11, 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.

Bug: CMD + A doesn't capture first DecoratorNode
3 participants