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

The Pinch event can't work

Open tobeyouth opened this issue 10 years ago • 3 comments
trafficstars

Here is my code:

render () {
    return (
      <div className="mapBox">
        <Hammer component="div" 
          onPinch = { this.pinchHandler.bind(this) }
          onRotate={ this.rotateHandler.bind(this) }
          options={ options }>
          <div id="svgMap" className="svg-map" style={ stype } ref="svgMap"></div>
        </Hammer>
      </div>
    )
}

but the pinchHandler and the rotateHandler don't run

is there have some question ?

tobeyouth avatar Jul 14 '15 14:07 tobeyouth

+1 have the same issue! update:

by default: Pinch- and RotateRecognizers are disabled, dunno why...

to enable it just append the following options to your Hammer element:

options={{
   recognizers:{
      pinch : { enable:true }
   }
}}

KaiHufenbach avatar Aug 25 '15 19:08 KaiHufenbach

+1 thanks for sharing, that worked great

andrewash avatar Dec 22 '15 16:12 andrewash

Any chance someone would mind submitting a PR to update the readme with this info?

JedWatson avatar Dec 26 '15 12:12 JedWatson