Touch devices dropdown support#965
Merged
tiagonoronha merged 4 commits intomasterfrom Sep 21, 2018
Merged
Conversation
peterfabian
requested changes
Sep 19, 2018
Contributor
peterfabian
left a comment
There was a problem hiding this comment.
Just one note, otherwise works fine.
| } ); | ||
|
|
||
| // Ensure the dropdowns close when user taps outside the site header | ||
| [].forEach.call( document.querySelectorAll( '.site-content, .header-widget-region, .site-footer' ), function( element ) { |
Contributor
There was a problem hiding this comment.
The dropdown does not close if the user clicks in the header area, e.g. to search products via the input, etc. It's not critical, but would be nice if that behaved in the same way as when clicking somewhere else on the page.
Contributor
Author
|
@peterfabian It's really trick to allow for clicks inside the header area because I would need to basically listen to events on all elements, but I made a change that target a few elements in the Header so, for example, clicking on the search input, will close the dropdown. |
peterfabian
approved these changes
Sep 21, 2018
Contributor
peterfabian
left a comment
There was a problem hiding this comment.
Great, much better now.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds touch support for navigation dropdowns when using an handheld device such as an iPad.
How to test:
Create a menu with dropdowns and assign it to the "Primary navigation" area.
Use an iPad or switch Chrome to mobile mode and select the iPad Pro from the list of devices (if using Chrome, reload the page after switching to the iPad).
Tap on the drop down to open it. The first tap should open the dropdown. A second tap on the same item should navigate away to the correct page.
Closes #962.