Skip to content
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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

goldenapples
Copy link
Collaborator

@goldenapples goldenapples commented Mar 8, 2023

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.

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.
@goldenapples goldenapples requested a review from MiguelAxcar March 9, 2023 16:39
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.
Copy link
Collaborator

@MiguelAxcar MiguelAxcar left a 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 ) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( dropdownMenuItems.lenght !== 0 ) {
if ( dropdownMenuItems.length !== 0 ) {

@varnent
Copy link
Collaborator

varnent commented Apr 19, 2023

@goldenapples - Looks like this is on hold - correct?

@varnent varnent marked this pull request as draft April 21, 2023 16:09
@varnent varnent marked this pull request as ready for review May 9, 2023 21:34
@varnent varnent marked this pull request as draft May 9, 2023 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants