Page MenuHomePhabricator

When you delete a parameter, the template dialogue box scrolls up to the top, and it should stay in the same place
Closed, ResolvedPublic

Description

Steps to reproduce:

  • Open the template dialogue, e.g., to edit an infobox.
  • Scroll down and delete a parameter, (e.g., "image").
  • Watch the dialogue box scroll up to the top.
  • Wish that it stayed where it was, so you could delete the next parameter (e.g., "image width"), too.

Request made by @SpikeballUnion at https://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback/Archive_2017_1#Deleting_infobox_parameters_scrolls_screen_to_top_of_dialogue_box See his screenshots that show the position before deleting the parameter and immediately after deleting it.

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptNov 9 2017, 6:28 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Elitre added a subscriber: Deskana.Jan 12 2018, 1:59 PM
Elitre added a subscriber: Elitre.

Reported again on mw.org. I can also reproduce.

Deskana triaged this task as Normal priority.May 10 2018, 3:26 PM
Deskana edited projects, added VisualEditor (Current work); removed VisualEditor.
DLynch added a subscriber: DLynch.May 16 2018, 9:27 AM

Issue is subtle fallout from the async-promises change, I think?

  1. ve.ui.MWTemplateDialog.prototype.onRemoveParameter calls this.bookletLayout.removePages(pages);
  2. removePages (in OOUI) calls this.selectFirstSelectablePage();
  3. onRemoveParameter then calls this.setPageByName( reselect.getName() );

There is a complicated mess of emitted events and queued animations, but the ultimate result seems to be that the initial "select first page" action happens, and the second "select closer page" doesn't. Or they do happen but out of order, maybe? Untangling the exact sequence is a pain.

matmarex claimed this task.Jun 21 2018, 6:18 PM

Change 441424 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] ve.ui.MWTemplateDialog: Prevent scrolling to top after removing a parameter

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

Change 441424 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ve.ui.MWTemplateDialog: Prevent scrolling to top after removing a parameter

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

Deskana closed this task as Resolved.Jun 26 2018, 2:42 PM