-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#765] Enable dropdowns on desktop for all sections #36
base: main
Are you sure you want to change the base?
Conversation
Updates the markup so that dropdowns are initialized properly on desktop, just like on mobile. Still needs some work - the menu is setup properly on first load, but after switching to mobile view and back, the menu doesn't get re-initialized properly.
Ensures that the subnavs get the correct values for "visible" and "toggleable" after switching viewports.
The underline around the current menu item is being positioned absolutely with z-index of 10, so it's important to cover it and avoid confusion.
Dropdowns have a different relative parent than the currently-open submenu, so they need magin and padding added to match the expected positioning.
Fixes the behavior of the dropdown on desktop so that only one sub-men can be open at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work!
Despite needing some final styling, the functionality is working as expected, and the navigation through keyboard follows a good logic:
- if all dropdowns are closed: parent items + carets
- when user open any dropdown: parent item, caret, submenu items
If user closes the submenu, it restores the navigation.
/** | ||
* Adds class if there's dropdown menu. | ||
*/ | ||
if ( dropdownMenuItems.lenght !== 0 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( dropdownMenuItems.lenght !== 0 ) { | |
if ( dropdownMenuItems.length !== 0 ) { |
@goldenapples - Looks like this is on hold - correct? |
Updates the markup so that dropdown menus are initialized properly on desktop, just like on mobile. Ready for code review, but I also want to get some user testing done, since this design isn't at all obvious in the context of drop downs.
These dropdowns work on click or keyboard, but not on hover, and actually as it stands the designs don't really allow for hover interaction without substantial rework.