Page MenuHomePhabricator

Clicking on an edit check shouldn't cause a scroll in mid-edit moment
Closed, ResolvedPublic

Description

The code tries to scroll the text to the top of the page, but that only applies to the pre-save moment when checks are shown at the top

Event Timeline

Change #1161475 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] EditCheck: Only align selection to top in pre-save check on desktop

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

Quick clarification of what the patch does for the record: it'll still scroll the check's selection into view, it just won't force it to the top.

Change #1161475 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] EditCheck: Only align selection to top in pre-save check on desktop

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

Quick clarification of what the patch does for the record: it'll still scroll the check's selection into view, it just won't force it to the top.

Yes, although in almost all cases this means no scrolling will happen, as in order to click on the card it has to be a view, and the card is usually pretty well aligned with the text selection so the text selection is likely already in view too.

Looks good to me. However,

In a paste check scenario like the below screenshot, some cards are not aligned

image.png (1×3 px, 463 KB)

Clicking the card scrolls the affected piece(not the full paragraph) into view.

image.png (1×3 px, 340 KB)

I think both of those are expected behavior. For the first, it's a situation where aligning directly with the text is impossible. For the second, just moving the check-related text into view is what's expected (and is the behavior before this patch as well).

Verifying since we are aligned then.