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

Event issue with panning on firefox #692

Open
renarsvilnis opened this issue Oct 21, 2014 · 6 comments
Open

Event issue with panning on firefox #692

renarsvilnis opened this issue Oct 21, 2014 · 6 comments

Comments

@renarsvilnis
Copy link

Hi, i have build a gallery for a project i'm currently working on. Build using the newest (2.0.4) handlebar.js version. But encountered issue |or my fault?! with previous and current Firefox (32.0.3) versions.

Brief issue description
When i click the image and start paning i recieve the "panstart" and only one "panleft panright" event. But i don't recieve other "panleft panright" events. Then when i realease my mouse (mouseup). Only then the start to recieve more "panleft panright" events which moves the gallery according to the cursor. Only on the next new click on the element i recieve the "panend" event.

Try it out yourself - Codepen to the gallery

Tested on with no issues:

  • Firefox android (33.0)
  • Chrome (38.0.2125.104)
  • Safari (>=7.1)
  • Android chrome (38.0.2125.102)
  • Mobile safari (>= 6)
  • Opera (>= 24)

Heres a snippet from the codepen javascript which has all the Hammer.js logic i have there.
Tried changing the threshold which didn't help.

// snippet from gallery
var gallery = $('.gallery')[0];

var options = {
  panThreshold: 0, // threshold after which hammer pan even is called
};

var hammerEvent = new Hammer(gallery);
hammerEvent.get('pan').set({
  direction: Hammer.DIRECTION_HORIZONTAL,
  threshold: options.panThreshold
});

hammerEvent.on('panstart', function(ev) {
  // start stuff
});

hammerEvent.on('panend', function(ev) {
  // end stuff
});

hammerEvent.on('panleft panright', function(ev) {
  // move stuff
});

Tried replacing my Handlebar.js version to older release. And found out that the issue started from version 2.0.2.

Test results for different Handlebar.js versions:

  • v2.0.0 - works fine
  • v2.0.1 - works fine
  • v2.0.2 - Firefox issue
  • v2.0.3 - Firefox issue
  • v2.0.4 - Firefox issue

For now
Just downgraded my Handlebar.js version to 2.0.1.

@renarsvilnis
Copy link
Author

Still, no ideas what might have caused it?
Isn't anyone else experiencing it?

@neil-s
Copy link

neil-s commented Apr 6, 2015

I'm finding the same issue in the latest Firefox, when using https://atmospherejs.com/chriswessels/hammer with Meteor. Interestingly, in my project, it fires 'panright' when I actually move my finger up on an image. Hence, it seems like Hammer loses its sense of direction in Firefox.

@hpet
Copy link

hpet commented Jun 22, 2015

I have the same issue with the latest library. On desktop and using firefox, dragging events don't work properly. Object is still dragged when mouse is released, until next click. This behavior can be seen on the example: http://cdn.rawgit.com/hammerjs/touchemulator/master/tests/manual/hammer.html

Maybe this has something to do with the touch emulation? I can't confirm this because I don't have any touch device available with firefox browser.

@brwnll
Copy link

brwnll commented Sep 8, 2015

Also experience the same issue as @hpet. In FireFox 40.0.3 and HammerJS 2.0.4, the "pan" event is triggered after clicking, then releasing. And it will then continue to trigger the "pan" event on mousemove until you click the page again.

Is there a known workaround for this? Or will I need to create separate drag functionality for desktop users?

Edit: I was also able to revert to HammerJS 2.0.1 and the issue was not present.

@subeebot
Copy link

We have the same issue with 2.0.4. Events are delayed until after a click and keep firing until the following click. Using Firefox 41.0.2 on OS X. HammerJS 2.0.1 works fine.

@manuelodelain
Copy link

Still have the issue with Firefox 52.0 / Hammer 2.0.8
Same workaround, downgrade to 2.0.1

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

6 participants