Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Opposite of needsclick? #290

Closed
williamboman opened this issue Aug 22, 2014 · 3 comments
Closed

Opposite of needsclick? #290

williamboman opened this issue Aug 22, 2014 · 3 comments

Comments

@williamboman
Copy link

Hey. Is there a functionality which functions as the opposite of .needsclick?

I'm currently having issues on mobile devices that doesn't need fastclick (for example Chrome on Android > 4) and angular-ui/bootstrap's popover directive. The popover is now triggered on click, but I don't want it to be triggered at all on mobile devices.

(I wasn't expecting this library to solve this issue, but it would be awesome if it had a solution to my problem)

BR

@matthew-andrews
Copy link
Contributor

Hmm.. not sure if this fits your use case but I did make selective fastclick so that FastClick can be deployed in a more targeted way.

So in this case maybe you would add a (for example) needsfastclick class to all your elements that could work with synthetic clicks then perhaps do this:-

selectiveFastclick.attach(document.body, ['.needsfastclick']);

Would that work for you?

@williamboman
Copy link
Author

Will this work in conjuction with FastClick? As in FastClick.attach(document.body)?

If yes, then it's exactly what I need 👍!

@matthew-andrews
Copy link
Contributor

I'm not sure what you mean here. Selective FastClick is FastClick, just targeted at specific selectors.

Because FastClick is greedy if you use both it and Selective FastClick, that would be the same as just using FastClick* on its own. (Clicks that match Selective FastClick selectors would be sped up by Selective FastClick, all others would be sped up by FastClick - either way they get sped up)

* Assuming you attached FastClick to document.body.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants