Fix a couple mobile bugs on the unified banner's review menu.
Review Request #14130 — Created Aug. 29, 2024 and submitted
We had a couple bugs when using the review menu on mobile.
The first has to do with the event overlay that we add to the page when the
review menu opens. The overlay wasn't going away when closing the menu by
tapping somewhere else on the unified banner (i.e. tapping the mode selector,
publish buttons or empty space). And, if you opened the review menu again, a
new overlay would be added, and the overlays would keep stacking if you
repeated this.This is fixed by listening to the closing event on the menu and removing
the overlay that way. Previously, we subclassed thecloseMenu()
method that exists on the parentActions.MenuActionView
and put the
overlay removal logic in there. However that method doesn't actually
always get called when the menu closes. The grandparent InkMenuView
sometimes closes the menu directly through itsclose()
method. We may
want to remove or rework theseActions.MenuActionView.openMenu()
and
closeMenu()
methods in the future, since it could lead to unexpected
state leftover like it did here.Secondly, the contents of the menu would get cut off when viewing on
mobile. This change makes things look much better by forcing the menu
contents to take up the entire width of the screen and wrap any text
in it.
- Tested opening, closing, and selecting items in the review menu in
mobile and desktop. - Tested exiting the review menu by it and a lot of other places.
- Tested scrolling with the menu open.
- Ran JS unit tests.
Summary | ID |
---|---|
62e2ea7bdcb15660fc0043d9652c041b4f024dfc |
Description | From | Last Updated |
---|---|---|
Typo in the description: "we subclasses" -> "we subclassed" |
chipx86 | |
Does this permanently alter the wdith and other information? If you trigger this in a mobile width, then close the … |
chipx86 | |
We should aim to use default styles but not assume them, in case those need to change down the road. … |
chipx86 |
- Change Summary:
-
- Reorded function definitions so that private ones come after protected ones.
- Reverts back to default styling when we switch out of mobile view.
- Description:
-
We had a couple bugs when using the review menu on mobile.
The first has to do with the event overlay that we add to the page when the
review menu opens. The overlay wasn't going away when closing the menu by tapping somewhere else on the unified banner (i.e. tapping the mode selector, publish buttons or empty space). And, if you opened the review menu again, a new overlay would be added, and the overlays would keep stacking if you repeated this. This is fixed by listening to the closing event on the menu and removing
~ the overlay that way. Previously, we subclasses the closeMenu()
~ the overlay that way. Previously, we subclassed the closeMenu()
method that exists on the parent Actions.MenuActionView
and put theoverlay removal logic in there. However that method doesn't actually always get called when the menu closes. The grandparent Ink MenuView
sometimes closes the menu directly through its close()
method. We maywant to remove or rework these Actions.MenuActionView.openMenu()
andcloseMenu()
methods in the future, since it could lead to unexpectedstate leftover like it did here. Secondly, the contents of the menu would get cut off when viewing on
mobile. This change makes things look much better by forcing the menu contents to take up the entire width of the screen and wrap any text in it. - Commits:
-
Summary ID 03085618495099e1fb0eaffb670c8fd11b58274a 9c8c4873be3450ff513c5534f33a107fcf3c8257 - Depends On:
-
- Diff:
Revision 2 (+110 -22)
Checks run (2 succeeded)
flake8 passed.JSHint passed.