-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Research blocking rendering selection while selection is being made #10430
Comments
|
There are two separate problems that contribute to the glitches with mouse selection anchoring at links/markers/mentions: DOM selection on the wrong side of the inline fillerWe never want to have the DOM selection start before the inline filler (not sure why, though). But this sometimes happens randomly as the user starts selection at a different point (geometrically, using the mouse). And we fix this if it happens. And as we fix it, we break the flow of the user selection https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/view/domconverter.js#L1013-L1016 // What user did by accident
// (also, imagine they are moving mouse right to select more)
<p>[]&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;<a>FOO</a></p>
// We fix into by imperatively collapsing it in DOM.
<p>&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;[]<a>FOO</a></p>
// Which breaks the flow of creating the selection using mouse;
// the selection remains collapsed forever despite moving mouse right.
// BTW: The filler will be also removed (see the second problem) in this case so
// this HTML is just to give you the idea of what happened.
<p>&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;<a>FO[]O</a></p> This could be fixed by blocking the imperative rendering of the DOM selection while the selection is being made (which is the scope of the research).
The disappearing inline fillerWhile the selection is being made, the inline filler disappears because it's no longer needed. When it disappears, the DOM selection anchored in that filler is collapsed by the web browser to the focus position. Then, as the user continues moving the cursor using the mouse, it stays collapsed forever. // That's cool. We need this filler.
<p>&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;[]<a>FOO</a></p>
// But now the inline filler is obsolete...
<p>&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;&NBR;[<a>F]OO</a></p>
// So the filler is out and the browser DOM selection collapses to the focus position.
// The flow of extending the selection using the mouse was broken.
<p><a>F[]OO</a></p> This could be fixed by keeping the inline filler as long as the selection stays in the same block.
|
Provide a description of the task
Research needed to move forward #10230.
Scope: Researching this point:
Source: #10230 (comment)
The text was updated successfully, but these errors were encountered: