generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 175
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
MWPW-146129 App Launcher overlaps the menu in Unav in the devices #2123
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
920c33c
Closes the global nav expanded wrapper in non desktop viewports when …
sharmrj beaf630
Merge branch 'stage' into unav-mobile
sharmrj 18e5aae
Merge branch 'stage' into unav-mobile
sharmrj bcf845d
Merge branch 'stage' of https://github.com/adobecom/milo into unav-mo…
sharmrj f1ac544
Merge branch 'stage' of https://github.com/adobecom/milo into unav-mo…
sharmrj 65c597f
We no longer use element.click
sharmrj 91ad1b9
made toggleMenuMobile a method of the Gnav class
sharmrj 1915b2a
Merge branch 'stage' of https://github.com/adobecom/milo into unav-mo…
sharmrj 9414bfc
Merge branch 'stage' of https://github.com/adobecom/milo into unav-mo…
sharmrj b8e6bd7
Extracted the toggle expanded check into its own function
sharmrj 19d2886
Merge branch 'stage' of https://github.com/adobecom/milo into unav-mo…
sharmrj 925972c
a little cleanup
sharmrj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
This seems not to work in adobe.com due to the following line (line 289 in utilities.js) in
closeAllDropDowns()
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.
Do you have a test link? Why does the element have the
fedsPreventautoclose
?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.
IMO emulating a click on the open element is not the right path. You should investigate why
fedsPreventautoclose
exists to begin with (might be related to the keyboard navigation using arrow keys, escape, etc.) and otherwise look into adapting thecloseAllDropdowns()
methodThere 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.
I don't have a test link. The test links don't load the unav because the request for the JS file
403
s. Since it's a one liner, I tested it by adding a breakpoint in the Gnav Constructor and adding in the line manually (you need to do cmd + s for it to work).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.
AFAICT it is, as you pointed out, related somewhat to the keyboard navigation files. It's difficult to say just from reading the code, but it seems that it makes somewhat of a distinction between specifically a dropdown and the menu as it opens in mobile and tablet viewports.
IMO
closeAllDropdowns
isn't what we're looking for here. What we're looking for specifically is inside thedecorateToggle
method:The most expedient way to call this function without a fairly significant refactor is by clicking on the element it's attached to. Furthermore it ties the behavior we want to the behavior of the actual html elements the end user interacts with, and not to the abstract way it is done in the code, which is liable to churn. In other words clicking on the toggle element decouples the implementation of the behavior (close the menu when we click on
feds-utilities
) from the implementation of how exactly clicking on the toggle hides/shows the menu.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.
I agree that we should generally avoid emulating click events, but in this scenario, it might be a reasonable approach. The
closeAllDropdowns
function is checking for open elements and whether they have the datasetfedsPreventautoclose
before closing. However, in this particular case, we need to overlook that and ensure that all menus close when someone clicks on the navigation.Another way would be for us to check open elements again, remove their dataset
fedsPreventautoclose
, and then call closeAllDropdowns, but in my opinion, that's not the right path to take. Therefore, using the click event seems fair in this scenario.