Automatically change popup direction if there is no space
Closed, ResolvedPublic

Description

Unless configured otherwise, popups should change direction if there is no space in their preferred direction (i.e. the popup hits the edge of the viewport/container and gets clipped to a very small size).

See also T114612: Add gravity option to OO.ui.PopupWidget

Related Objects

Catrope created this task.Feb 24 2017, 1:35 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 24 2017, 1:35 AM
matmarex claimed this task.Oct 6 2017, 7:46 PM
matmarex added a subscriber: matmarex.

This should be done not only for PopupWidget, but also for other dropdowny/popuppy things, e.g. DropdownWidget. (See comments on T107036)

So the re-orientation on normal <select> menus does work on a boundary. It's not automatically happening with only more size available above or below.

Change 385309 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] [WIP] MenuSelectWidget, PopupWidget: Automatically change popup direction if there is no space

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

Change 385309 merged by jenkins-bot:
[oojs/ui@master] MenuSelectWidget, PopupWidget: Automatically change popup direction if there is no space

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

matmarex closed this task as Resolved.Nov 29 2017, 3:26 PM
matmarex removed a project: Patch-For-Review.

That's a very nice solution.

Although not main focus of this ticket, having adaptable popup direction solved T160001 . I have rechecked after OOjs UI got updated and popup is indeed displayed above the highlight button when there is no room to display the popup below the button.
Here is how it looked on OOjs UI v0.24.2 and how it works on OOjs UI v0.24.3 with highlights popup on RC filters:

OOjs UI v0.24.2OOjs UI v0.24.3

Is this expected?

The main reason I'm writing on this ticket is to get confirmation if following behavior is expected; When button itself is clipped, the popup does not adjust pop up direction to be above the button, but is rather displayed below the button and clipped alongside.

matmarex added a comment.EditedDec 11 2017, 7:22 PM

That's a bug, I'll file another task and look into it.

T182650