Page MenuHomePhabricator

Extending backwards selection beyond top of viewport doesn't scroll correctly
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce:

  • open something long enough to not fit into the editbox
  • go to the end
  • start selecting upwards (e.g. with Shift-PgUp or Shift-Up)

Expected behavior: when the selection reaches the top of the edit box, the box starts scrolling upwards (this is how native textareas behave).

Actual behavior: selection passes by the top of the box, after which I can't see what I'm doing anymore. Even if I scroll the window manually, it jumps to scroll the end of the selection into view as soon as the selection changes.
(When changing the start of the selection, scrolling works as expected.)

Tested on Chrome 64.0.3282.119 (64-bit, Ubuntu 16.04).

(There is also blinking/flashing of the screen going on when I move the selection, both when moving the start and the end; but that's just ugly, it does not interfere with selecting the text.)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Esanders renamed this task from New wikitext editor: scrolling is based on range end position instead of cursor position when selecting to Extending backwards selection beyond top of viewport doesn't scroll correctly.Feb 5 2018, 3:41 PM

I think the issue is that https://gerrit.wikimedia.org/r/#/c/328395/ assumed that start/endRects corresponded to anchor/focus points respectively, when in fact start/end are always in document order.

Change 408289 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] scrollCursorIntoView: Collapse selection to 'to' (anchor)

https://gerrit.wikimedia.org/r/408289

Change 408289 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] scrollCursorIntoView: Collapse selection to 'to' (anchor)

https://gerrit.wikimedia.org/r/408289

Change 408721 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (2ac0e8b0c)

https://gerrit.wikimedia.org/r/408721

Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.

Change 408721 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (2ac0e8b0c)

https://gerrit.wikimedia.org/r/408721