Page MenuHomePhabricator

OOUI: In certain situations involving StackLayouts, removing items scrolls the focus up to the top
Open, HighPublic

Description

Steps to reproduce:

1.Open a page with VE
2.Go to Insert>Transclusion
3.Add a cite web template
4.Add some parameters to it
5.Add some more templates with parameters
6.Delete any of the parameter of any template or the template itself

Observed Result:

The focus of the dialog scrolls up to the top of the right panel.

Test Environment: http://en.wikipedia.beta.wmflabs.org/
Browser: Chrome Version 26.0.1410.65 & FF 25
OS: MAC OS X 10.8.5


Version: unspecified
Severity: minor
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=65882

Details

Reference
bz62420

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:53 AM
bzimport added a project: OOUI.
bzimport set Reference to bz62420.

So there's a couple of strange things going on here, which me and Trevor looked into during Wikimania. In OOjs UI:

  • OO.ui.StackLayout.prototype.removeItems tries to scroll to the top item (if it exists) if we're removing the current item. Otherwise we just unset the current item.
  • It seems that in OO.ui.OptionWidget.prototype.setSelected we should be checking that the element we're scrolling to is actually visible. (So it's not just an OO.ui.OutlineWidget thing.)
    • Unfortunately this isn't as simple as this.$element.is( ':visible' ) because visibility:hidden; is not picked up by jQuery as being non-visible... So you have to hack OO.ui.GridLayout.prototype.update to use display:none; for this instead. Which probably breaks other things.

So shall we move this into the OOjs UI component and reassign it?

I recently filed T75694 which seems to be the same thing, but with more weird behaviors.

Volker_E renamed this task from OOjs UI: In certain situations involving StackLayouts, removing items scrolls the focus up to the top to OOUI: In certain situations involving StackLayouts, removing items scrolls the focus up to the top.Jan 17 2018, 12:55 AM
Volker_E updated the task description. (Show Details)