Page MenuHomePhabricator

DropdownWidget menu sized incorrectly when inside scrolled BookletLayout
Closed, ResolvedPublic1 Estimated 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 raised the priority of this task from to Needs Triage.
Anomie updated the task description. (Show Details)
Anomie added a project: OOUI.
Anomie subscribed.
Jdforrester-WMF set Security to None.
Jdforrester-WMF added a subscriber: matmarex.

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 Medium.
Jdforrester-WMF moved this task from Backlog to Doing on the OOUI 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