Page MenuHomePhabricator

Cannot select date from calendar inside Media upload dialog when the browser window is resized in a way that it overlaps with the calendar
Closed, ResolvedPublic

Description

Steps to reproduce:

1.Go to Upload media dialog
2.After selecting an image when you are in the media settings dialog for the details section reduce the window size in a way that it overlaps with the calendar

Observe that, there is no scroll bar appearing so cant select the dates that are below the border

Screen Shot 2015-10-19 at 3.41.11 PM.png (484×1 px, 145 KB)

Event Timeline

Ryasmeen raised the priority of this task from to Needs Triage.
Ryasmeen updated the task description. (Show Details)
Ryasmeen added a project: VisualEditor.
Ryasmeen subscribed.

Ideas @matmarex shared for addressing this:


i.

Screen Shot 2021-12-22 at 8.49.11 AM.png (1×2 px, 216 KB)

matmarex moved this task from Freezer to Triaged on the VisualEditor board.
matmarex moved this task from Untriaged to This Fiscal Year on the Editing-team board.

Comparing this with another widget which uses a popup (DropdownWidget), it looks like MenuSelectWidget.js:477 contains the code responsible for automatically flipping the direction that the menu appears when the dropdown is activated. It relies that ClippableElement is mixed in, however (since it needs to know whether or not the dialog will get clipped vertically, and that function is only exposed within ClippableElement). So the idea of making the calendar clippable/scrollable would solve both the issues with it being clipped when too close to the bottom of the screen and also allow the calendar to flip when the space below it is too little. A demonstration for this can be found with P51429. Not sure if this is the best solution for this yet so I've kept it a paste for now; do tell if this should be turned into a patch.

There could be other ways of fixing this, such as adding just the check to see when the calendar gets cut off by the viewport. This removes the scrolling (which could be an unwanted effect given that this is a calendar and not a dropdown menu) but doesn't handle a case where the calendar may be squeezed between a narrow space (but realistically this isn't a justifiable edge case; little to no one would have the window at 300px tall). Any thoughts on this?

I tried out your patch and it works and makes sense to me. I'd be happy to merge that change if you submit it. Thanks for looking into it!

I don't really know why that wasn't done before, it might have been just laziness more effort than we wanted to put into this interface. It's also possible that someone really disliked the scrolling when the calendar is clipped, but you're right that it will probably never happen in practice, so it doesn't seem worth trying to improve it.

Will submit the patch in a bit, thanks for checking it out! 😀

Change 953356 had a related patch set uploaded (by Chlod Alejandro; author: Chlod Alejandro):

[mediawiki/core@master] CalendarWidget: Make clippable, scrollable

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

Change 953356 merged by jenkins-bot:

[mediawiki/core@master] CalendarWidget: Make clippable, scrollable

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