react-hammerjs icon indicating copy to clipboard operation
react-hammerjs copied to clipboard

Customize hammerjs

Open mperkh opened this issue 8 years ago • 1 comments

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.

mperkh avatar Jan 13 '17 10:01 mperkh

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;

andriinuts avatar Sep 18 '20 14:09 andriinuts