Page MenuHomePhabricator

DropdownWidget menu sized incorrectly when inside scrolled BookletLayout
Closed, ResolvedPublic1 Story Points

Description

Create the test like this:

var items = [];
for ( var i = 0; i < 100; i++ ) {
  items[i] = new OO.ui.MenuOptionWidget( { data: i, label: String(i) } );
}

var page = new OO.ui.PageLayout();
for ( var i = 0; i < 20; i++ ) {
  page.$element.append( $( '<p>' ).text( 'spacing...' ) );
}
page.$element.append( new OO.ui.DropdownWidget( { menu: { items: items } } ).$element );
for ( var i = 0; i < 100; i++ ) {
  page.$element.append( $( '<p>' ).text( 'spacing...' ) );
}

var booklet = new OO.ui.BookletLayout( { 
  outlined: true
} );
booklet.addPages ( [ page ] );
$( 'body' ).append( booklet.$element );

Scroll the pane of the BookletLayout so it's not at the top. Open the DropdownWidget. The dropdown menu will extend off the bottom of the visible area, at least in Firefox 37.0.2 and Chromium 42.0.2311.135.

Event Timeline

Anomie created this task.May 7 2015, 6:41 PM
Anomie raised the priority of this task from to Needs Triage.
Anomie updated the task description. (Show Details)
Anomie added a project: OOUI.
Anomie added a subscriber: Anomie.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 7 2015, 6:41 PM
Jdforrester-WMF triaged this task as High priority.May 24 2015, 11:43 AM
Jdforrester-WMF set Security to None.
Jdforrester-WMF added a subscriber: matmarex.
Elitre added a subscriber: Elitre.May 24 2015, 11:44 AM

Change 210339 had a related patch set uploaded (by Bartosz Dziewoński):
Preserve scroll position in OO.ui.Element.static.reconsiderScrollbars

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

Change 213284 had a related patch set uploaded (by Bartosz Dziewoński):
ClippableElement: Fix behavior of long clippables

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

Change 213285 had a related patch set uploaded (by Bartosz Dziewoński):
ClippableElement: Fix behavior of clippables in nested scrollables

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

Can we get some information about how or if this affects VisualEditor?

It mostly doesn't. It only causes problems when the dropdown menu is higher than screen height (which is probably never the case with any dropdown VE uses), or when it was nested inside another scrollable element (which is probably never the case in VE either, as all the dropdowns are inside fixed-positioned dialogs or just in body).

Jdforrester-WMF lowered the priority of this task from High to Normal.
Jdforrester-WMF moved this task from Backlog to Doing on the OOUI board.
Jdforrester-WMF closed this task as Resolved.Jun 3 2015, 9:07 PM
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from Nominated to Done on the VisualEditor 2014/15 Q4 blockers board.

Change 210339 merged by jenkins-bot:
Preserve scroll position in OO.ui.Element.static.reconsiderScrollbars

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

Change 213284 merged by jenkins-bot:
ClippableElement: Fix behavior of long clippables

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

Change 213285 merged by jenkins-bot:
ClippableElement: Fix behavior of clippables in nested scrollables

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

Jdforrester-WMF moved this task from Doing to Reviewing on the OOUI board.Jun 3 2015, 9:12 PM