Skip to content

Override selectall on RangeSelection#4671

Merged
zurfyx merged 2 commits intomainfrom
fix-selection2
Jun 16, 2023
Merged

Override selectall on RangeSelection#4671
zurfyx merged 2 commits intomainfrom
fix-selection2

Conversation

@zurfyx
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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

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