Comments (4)
The closer to hammer.js the better. Best would be if this library wouldn't be necessary at all ;).
This is an interesting case, so far I hadn't used emit
and therefore didn't encounter this issue. I think this problem boils down to the internal property _firstTarget
not being set in case of an event fired via emit
.
I've added some code overriding hammers emit
event, see ff7b6a7. Can you check whether this solves the issue?
from propagating-hammerjs.
Yes. That fix allowed me to remove the extra emit()
in my tests.
btw, I was using emit
in my tests because that's what I saw you doing in your tests. Is this the best way for me to be testing my app's use of hammerjs? I manually create an event object that is an ordinary javascript object (not an Event
) and fill in the details that hammerjs uses. But this required some trial an error, and inspection of hammerjs's source code to get working. It's also probably rather brittle. It's also not easy to simulate more elaborate gestures.
Is there a better way to do this? Does hammerjs expose an interface (other than emit
) that works well for simulating events during tests?
from propagating-hammerjs.
Ok great that it works.
I'm not sure which tests you mean, at least propagating-hammerjs
doesn't have tests (sorry for that).
from propagating-hammerjs.
I don't know what is the preferred way to test touch events with hammer. I suppose the "right" way is to create real DOM events and fire them via real DOM event handlers attached to real DOM elements. But that's not so trivial.
from propagating-hammerjs.
Related Issues (11)
- Anyway to run client side with Meteor HOT 11
- panmove is not work when swipe first time in device of android HOT 1
- angular 6/7 HOT 1
- export also as ESM module HOT 2
- Doesn't work when using the jquery.hammer plugin HOT 4
- Performance of Vertical Scroll is less in android chrome using propagating.js HOT 1
- Use apply() in stopPropagation wrapper HOT 3
- Propagation is not stopped for dynamically added items HOT 2
- Multitouch does not work HOT 4
- needs domEvents:true? but this causes issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from propagating-hammerjs.