Fix a couple mobile bugs on the unified banner's review menu.
Review Request #14130 — Created Aug. 29, 2024 and submitted — Latest diff uploaded
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.