-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Rich text: avoid updating partial selection unnecessarily #44330
Rich text: avoid updating partial selection unnecessarily #44330
Conversation
Size Change: +114 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
Nice, fast work, that does fix the flicker for lists: However it reintroduces an older issue we had where when hovering between paragraphs it goes into "full selection" rather than partial selection: This could be because I'm not testing this PR correctly, I just tried it out and used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This works well!
In this example I've merged in #44150, and as you can see on the list, I have a todo item attached there. But this fixes the issue. Thank you.
I'll need to add some inline comments, cause it's getting a bit unclear what is happening. |
What?
This should fix the flicker in #44150 (comment).
Why?
Who likes flicker?
How?
The problem is that in the selection observer, we detect that the selection start is e.g. the paragraph block, and the selection end is in e.g. a list item, so it resets the depth of the selection end to the list block instead of the list item so that the list block is fully selected.
However, rich text will just ignore this, detect some selection end in the list item, and set the selection end offset together with the new client ID of the list item. So the solution is to check if the client ID to update is the same as one we have in the store, otherwise just ignore what rich text is detecting.
Testing Instructions
Screenshots or screencast