Page MenuHomePhabricator

PopupWidget is not correctly clipped with left/right edge (other ClippableElements work fine)
Closed, ResolvedPublic

Description

PopupWidget is not correctly clipped with left/right edge (other ClippableElements work fine). This is because of the hardcoded 320px width (or any other explicit width) on the .oo-ui-popupWidget-popup ($clippableContainer), which is the parent element of .oo-ui-popupWidget-body ($clippable).

ClippableElement expects the container to adjust to the dimensions of the clippable, but since it has an explicit width it doesn't, and all hell breaks loose. We can't simply remove the width, because that will cause popups to become very narrow (as narrow as possible to render the text in them). I don't know how to solve this.

Note that this is rarely an issue, as PopupWidgets try to move themselves to the right/left if they would overlap the left/right edge. However in some cases it is not possible, e.g. for popups with position: 'before'/'after' or when the viewport is narrower than the popup.

LTRRTL
image.png (610×1 px, 56 KB)
image.png (610×1 px, 55 KB)

Event Timeline

I'm not sure if it's the same issue, but I'm reporting here since it seems related.

Open the PopupButtonWidget (framed, no popup head, position: after)‎ example, and resize the browser window so the popup width doesn't entirely fit on screen, When the popup is open, it displays correctly initially, but when you scroll the page the height increases abnormally and the popup body disappears

Yeah, I think that's the same thing.

Change 801436 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[oojs/ui@master] PopupWidget: Fix clipping when the popup is forced to be narrower

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

Change 801436 merged by jenkins-bot:

[oojs/ui@master] PopupWidget: Fix clipping when the popup is forced to be narrower

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

Change 817802 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] Update OOUI to v0.44.2

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

Change 817802 merged by jenkins-bot:

[mediawiki/core@master] Update OOUI to v0.44.2

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

matmarex claimed this task.