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

Customize hammerjs #62

Open
mperkh opened this issue Jan 13, 2017 · 1 comment
Open

Customize hammerjs #62

mperkh opened this issue Jan 13, 2017 · 1 comment

Comments

@mperkh
Copy link

mperkh commented Jan 13, 2017

The documentation does not make it clear, how to configure hammerjs, like

/* common hammerjs customization */
delete Hammer.defaults.cssProps.userSelect; // restore text highlight on desktop
Hammer.defaults.inputClass = Hammer.TouchInput; // only recognize gestures on touch inputs

How is it possible to to use react-hammerjs using this hammerjs config? Using options={{inputClass: 'Hammer.TouchInput'}}, as the documentation might suggest didn't work.

@andriinuts
Copy link

You can add hammerjs dependency to your project like: npm i hammerjs.
Then just import Hammer from hammerjs and you will have the possibility to modify some default settings like: Hammer.defaults.inputClass = Hammer.TouchInput;

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

No branches or pull requests

2 participants