Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Prevent triggering of link that slides into spot where menu trigger is located when closing menu #27

Merged
merged 1 commit into from
Nov 11, 2014

Conversation

mattg
Copy link

@mattg mattg commented Mar 27, 2013

In a design I'm working on, when the menu trigger is tapped to close the menu, the tap also triggers the link that slides into the spot the menu trigger occupied. You can prevent this sort of thing from happening in mobile browsers by adding a preventDefault to the event, which is what I did. I'm guessing that there are other cases that I did not personally encounter where your library would benefit from this addition.

This happens in Chrome for Android and Safari on iOS. Probably other mobile browsers, too.

@thelar
Copy link

thelar commented Sep 25, 2013

Great tip - works!

@katrillion
Copy link

This is glorious - thank you!

@cmoy
Copy link

cmoy commented Nov 12, 2013

This works, thanks

acolangelo added a commit that referenced this pull request Nov 11, 2014
Prevent triggering of link that slides into spot where menu trigger is located when closing menu
@acolangelo acolangelo merged commit 5d1598e into acolangelo:master Nov 11, 2014
acolangelo pushed a commit that referenced this pull request Nov 11, 2014
Also added an `e.preventDefault()` call to the content click, as well as `touchend`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants