Code Monkey home page Code Monkey logo

propagating-hammerjs's Issues

Doesn't work when using the jquery.hammer plugin

How can I get this to work with the jquery plugin for hammer 2.0?

If I use the hammer plugin propagation doesn't work. If I don't use the hammer plugin hammer propagation does work with your propagation.js script

needs domEvents:true? but this causes issues

Hi,

is the domEvents setting required to be set to true? i have been unable to get propagating to work without this setting (no events being triggered at all..)

but once I set this setting to true other issues arise from the fact that I hammer() nested elements and if an event gets triggered on a child and a parent is also hammer()ed, the event gets triggered twice..

perhaps you have any experience and suggestions with getting propagating to work without domEvents:true? I see in your examples that this is not needed but as soon as I plug it into our code no events are being triggered until I set domEvents to true..

Thanks so much!
Anna

export also as ESM module

We get the following waning in an Angular project using keychartm (for vis-timeline):

WARNING in node_modules/vis-timeline/esnext/esm/vis-timeline-graph2d.js depends on 'propagating-hammerjs'.
CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

It would be helpfull to also export a ESM module.

panmove is not work when swipe first time in device of android

I am facing issue with "panmove". when i swipe bottom to top and top to bottom its not work first time. I have used Hammerjs with backbonejs hybrid mobile app. I have make a bottom penal when it swipe we do some more option. but its not work properly. when i swipe second time it work fine. at first time i am not getting panmove event same thing i am getting in ios device.

this.$el.html("#div")
this.$el.hammer();
this.$el.data('hammer').get('pan').set({ threshold: 5 });
this.initHeight = -(this.$el.outerHeight() - this.$('.swiper-container').outerHeight());
this.estimateTopPosition = this.$el.position().top;

//This function call on panup, pandown, panstart, panmove, panend, pancancel, panright, panleft, tap, press event
fareContainerSwipe: function (e) {
	var swipeType = e.type;
	var speed = 500;
	console.log(e.type + ', ' + e.gesture.offsetDirection + ', ' + e.gesture.direction + ', ' + e.gesture.distance + ', deltaY: ' + e.gesture.deltaY);
	var distance = e.gesture.distance;
	var nav = this.$el;
	var transInitHeight = this.transInitHeight;
	var currentPosition = this.$el.position();
	
	
	var mDistance;

	if (swipeType == 'panmove' && (e.gesture.direction == 16)) { //Pan down

	}else if (swipeType == 'panmove' && e.gesture.direction == 8) {    //Pan up

	}
} 

Propagation is not stopped for dynamically added items

Hi, I'm working on react app (in fact preact but doesn't matter so much) and I add points inside of some plane(<div />). Points and the plane can be dragged independently with mouse pointer. So I have to stopPropagation on a point to prevent pan event propagate up to the plane and prevent it to be shifted too. So if I add a new point dynamically - stopPropagation doesn't work on newly added point. After refresh page - it works just fine.

I would happy to make live example, please just let me know if you still maintain this repo and I'll provide you reproduced issue.

Use apply() in stopPropagation wrapper

Hello,

I am using vis.js (and consequently propagating-hammerjs) in conjunction with https://github.com/Pomax/react-onclickoutside. I am getting the following error for click events.

Chrome: Uncaught TypeError: Illegal invocation
Firefox: TypeError: 'stopPropagation' called on an object that does not implement interface Event.

I believe the following line should be changed to

srcStop.apply(event.srcEvent);

I didn't bother creating a PR since this is a very minor change.

Multitouch does not work

With original hammerjs, i can pan multi elements at same time.
But with propagating() multi touch does not work, can pan only one element at a time

Way to emit events in test code that is compatible with propagating-hammerjs

I started using propagating-hammerjs which works fine for my app but broke my tests. I realized I could fix my failing tests by emitting an additional event before each simulated event with something like the following:

hammerInstance.emit('hammer.input', {target: event.target, isFirst: true})
hammerInstance.emit(eventType, event)

I'm curious if this is the recommended way to simulate events in a propagating-hammerjs compatible way? Or is there a better way to simulate events that will work out of the box? or is there a way that propagating-hammerjs could be improved in such a way that the requisite setup for simulated events will have happened without manually needing to do it?

Anyway to run client side with Meteor

Hi,

as I understand it I can't run NPM modules client-side in Meteor. As this code has to run client-side I am a bit stuck.

Any hints (hacks) on how I could run this to help stop "press" events propagating back up the DOM, pls?

ps. I did try just including propagating.js in the client side folders but get an error propagating is not defined

any help appreciated, pls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.