Problem/Motivation
Follow-up to #3180086: It should not be possible to have two dropdown menus appear at the same time within Olivero
That issue added logic which closes the sub-menus whenever avresize event happened. The motivation was to prevent 2 sub-menus being open if you switch
But this is too greedy. Not all viewport resizing results in a change between wide and narrow menu versions. It's reasonable to have a wide menu, then make your viewport even bigger.
Steps to reproduce
Example:I have a HD monitor (1920 x 1080), and my browser window is currently 1300 x 700. I see the wide version of the menu. Now I open a sub-menu, and it has lots of items. I'd like more room to read those, so I use the maximise-window feature of my OS. The browser viewport grows from 1300px to 1920px wide. Does the menu remain open?
Proposed resolution
Don't close menus on all resize events. Instead, close them when you decide to switch between narrow and wide menus.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | Screen Recording 2021-08-24 at 10.30.05 AM.mov | 9.48 MB | andy-blum |
| #21 | 3191806-21.patch | 2.46 KB | mherchel |
Issue fork drupal-3191806
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
andy-blumTook a first swing at this adding a new prop to the
init()function to hold onto pre-resize width values. Additionally, addedDrupal.debounceto rate-limit the resize handler per the @todo in the file.Comment #4
gauravvvv commentedRe-rolled patch #3, Please review.
Comment #5
gauravvvv commentedComment #6
andy-blumTests will likely continue to fail as the patch was created against 9.x.3
Comment #7
gauravvvv commented9.3 will be ready for testing from week 3 of may.
Comment #8
andy-blum#2 indicates new changes should be made to the 9.3.x branch. Is that true or are minor fixes like this still aimed at the 9.2.x branch?
Comment #9
gauravvvv commentedI have 9.3 branch in my local. There are very minor changes in 9.2 and 9.3.
I made these changes in 9.3 and it still passes 9.2 and it will pass 9.3 as well.
Comment #10
guilhermevp commentedI was unable to test the issue properly, could use more explicit details in how to test it.
How I did it:
1-Created submenus in the home link,
2-Downsized navigation page to 1600 x 900,
3-Expanded the menu,
4-Changed page to full-screen
5-Menu closes, before and after patch.
Comment #11
andy-blumReroll of #5
Comment #12
mherchelComment #13
ranjith_kumar_k_u commentedFixed custom command failure
Comment #14
andy-blumNeeds a re-roll
Comment #15
xjmThis is a usability and accessibility issue, and is at least normal if not major. Content unexpectedly disappearing when I make my window bigger to try to read it sounds pretty bad, actually, so erring on the side of major.
Comment #16
mherchelComment #17
mherchelRe-roll attached.
Comment #18
mherchelComment #19
mherchelForgot to stage all my changes. New reroll attached.
Comment #20
mherchelI'm not opposed to integrating
Drupal.debounce, but I'd like to keep it out of the scope of this issue. We have aDrupal.olivero.isDesktopNav()method that can do this.I don't like that we're encoding the navigation change breakpoint here. This means that if we ever change it, we'll need to remember to change this.
Comment #21
mherchelAttached is a patch that compares the new and old
Drupal.olivero.isDesktopNav()value and if they don't match, it will allow the submenus to close.No interdiff as this is a different approach.
Tugboat preview: https://3191806-resize-menu-close-ualwvqluvczjwoxevbjdriwl9mah4b3j.tugbo...
Comment #22
mherchelAttached the same patch twice.
Comment #23
andy-blumThe desktop submenus only close when we shrink enough to get to the mobile menu, but the mobile menu closes on any resize event. Screen recording attached.
Comment #24
mherchelAdded this tag per the last attached movie.
Comment #27
hooroomoo(user bnjmnm is teaching me how to contribute to Olivero and asked that I make this a merge request to facilitate that process)
Comment #32
kristen polThanks for the update. Tagging for manual testing.
Comment #36
andy-blumComment #37
andy-blum"banjo music" is not a real tag.
Comment #38
mherchelComment #39
gauravvvv commentedUpdating attributions.
Comment #40
mgiffordAdding 1.4.10 SC.