hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
24.11k stars 2.63k forks source link

The event object isFirst forever false #1247

Open amnotbusy opened 4 years ago

amnotbusy commented 4 years ago

`var myElement = document.getElementById('myElement');

// create a simple instance // by default, it only adds horizontal recognizers var mc = new Hammer(myElement);

// let the pan gesture support all directions. // this will block the vertical scrolling on a touch-device while on the element mc.get('pan').set({ direction: Hammer.DIRECTION_ALL });

// listen to events... mc.on("panleft panright panup pandown tap press", function(ev) { console.log(ev.isFirst);//forever false myElement.textContent = ev.type +" gesture detected."; });`

marcinheniborg commented 4 years ago

Agreed. I'm using pinch event and wanted to set transformOrigin when the first event is triggered. Unfortunately ev.isFirst is always false.