josdejong / propagating-hammerjs Goto Github PK
View Code? Open in Web Editor NEWExtend hammer.js with event propagation
License: MIT License
Extend hammer.js with event propagation
License: MIT License
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
I have been using hammer along with propagating js in my project. I have a overflow scroll for a div enabled and pan recognizers to it at multiple levels. Use of propagating js causes poor vertical scroll effect
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
How to use with these angular versions?
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.
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
}
}
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.
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);
propagating-hammerjs/propagating.js
Line 204 in 7cab5b2
I didn't bother creating a PR since this is a very minor change.
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
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?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.