Writing flow: fix vertical arrow keys not moving#53454
Conversation
|
Size Change: +17 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
t-hamano
left a comment
There was a problem hiding this comment.
LGTM!
From what I have been able to find, this problem also occurs in browsers other than Safari and seems to be affected by the initial cursor position, browser size, amount of scrolling, etc. I have also observed the problem not only with vertical but also horizontal movement.
For example, in my environment, I observed at least the following problems in trunk:
Chrome: get stuck when moving down
Screencast
chrome_vertical_down.mp4
Chrome: get stuck when moving right
Screencast
chrome_horizontal.mp4
Firefox: get stuck on both upward and downward movement
Screencast
firefox_vertical.mp4
I have tried various scenarios with this PR and everything seems to work as expected without stacking, both vertically and horizontally 🎉
chrome_result.mp4
|
Awesome! Yes, it seems like sometimes it works in Chrome, and sometimes is doesn't. I noticed it often gets stuck when the container is exactly aligned with the scroll container viewport 🤔 |
What?
Fixes #44055. Sometimes vertical arrow keys get stuck when the container edge is out of view.
Why?
How?
The problem lies in
isVerticalEdgewheredocument.caretRangeFromPointcan not get a Range in some browsers because it's out of view. The solution is to scroll the container into view like we do forplaceAtEdge.Testing Instructions
Vertical arrow key in Safari
Testing Instructions for Keyboard
Screenshots or screencast