-
Notifications
You must be signed in to change notification settings - Fork 57
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
Swipe and vertical-swipe #58
Comments
My attempt to implement horizontal and vertical swiping listeners on the same component went as follows: // my-project/app/ember-gestures/recognizers/four-way-swipe.js
export default {
include: [],
exclude: [],
options: { threshold: 25 },
recognizer: 'swipe'
}; And my component... import RecognizerMixin from 'ember-gestures/mixins/recognizers';
const { $, computed } = Ember;
export default Ember.Component.extend(
RecognizerMixin, {
recognizers: 'four-way-swipe',
swipeDown() {},
swipeLeft() {},
swipeRight() {},
swipeUp() {},
} Unfortunately, none of the methods above are called. At least two are called when I replace recognizers with Is there a shared compatibility issue here or are we looking at two separate issues? Maybe the code outlined in this comment is just me misunderstanding the documentation but I want to keep the thread in one place until we confirm that. |
Coming full circle, my solution way to name the recognizer As such: // my-project/app/ember-gestures/recognizers/swipe.js
export default {
include: [],
exclude: [],
options: { threshold: 25 },
recognizer: 'swipe'
}; With: I hope this helps someone in a similar situation. |
@sir-dunxalot there's a secret hidden property that lets you inherit but rename, You should have been able to do |
Any news on this @sir-dunxalot |
I couldn't really replicate the solution exposed by @sir-dunxalot, but I was able to use swipeDown and swipeLeft by registering only the 'swipe' recognizer in the component by having a local swipe recognizers in |
Hi @jorgelainfiesta yes, I did the same, and it works like a charm, should have written it here so cudos for your initiative! |
Just coming through to clean up some of these lingering issues. @jorgelainfiesta @choclaudio are the solutions you guys used something we should update in this addon or document or does everything work as advertised now? |
Cool library!
Currently the default recognizers don't support horizontal and vertical swiping. For example,
recognizers: 'vertical-swipe swipe',
results in just horizontal swipe event firing andrecognizers: 'swipe vertical-swipe ',
result in just vertical swipe events firing.I'm hoping to be able write my own recognizer for a four-way swipe but I would expect the default recognizers to be compatible with one another.
The text was updated successfully, but these errors were encountered: