-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Writing Flow: fix list selection #19721
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
Conversation
It's not immediately clear to me: Why does this make a difference? Or, to refresh my memory, why do we collapse the selection at all in this function? |
|
I sorta wondered if this might have had something to do with an issue I've experienced in Chrome when dealing with selections that occur at ends of lines, where the dimensions are (unexpectedly) reported to exist on the following (preceding?) line: https://codepen.io/aduth/pen/WPjQoW This can happen a lot in our implementation when trying to ArrowDown after clicking at the end of a line of text. If the line is the second-to-last in a paragraph, it can often skip to the next block unexpectedly. But I tested the original issue in Firefox (where this bug/inconsistency does not exist) and it works correctly ¯\_(ツ)_/¯ |
|
We seem to collapse it for this calculation: And also for the horizontal edge calculation, in which case we want the left/right edge of the collapsed range, not the range as a whole (which can change if multiple line are selected). |
|
@aduth That's correct. I'm aware of the Chrome issue where it selection an invisible bit of the side of the first line. I'm unsure how to account for this. When taking the rectangle of the original range, the rectangle seems to be correct, so that's why I used it instead. |
|
I made an error when writing the e2e test and now it works fine. |
|
There was a failing test. Not one of the usual failures, but doesn't seem like it should be related: I've restarted the build. |
aduth
left a comment
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.
Tests well to me 👍
|
Thanks for the review! |
Description
Fixes #12656.
The problem is that we're looking at a collapsed range when determining if a range is at the vertical edge of an element.
Added an e2e test.
How has this been tested?
Screenshots
Types of changes
Checklist: