-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add touchAction
to the manager...
#23
Comments
I managed to create a work-around for this issue:
I know that this is a workaround which is not that nice, but I was in a hurry and thought I shared it. When I have time I will dive more into the code and maybe try a pull request to easily set touchAction. |
I had same issue on android firefox. Using swipe left, it can't be vertical scrollable. I soleved this issue by bellow. VueHammer.config.swipe = { hammerjs/hammer.js#1173 |
Hello, is the config for the whole App, and if, can it be set only for one component? |
Where did you put this? In your main.js? import { VueHammer } from 'vue2-hammer' Edit: I ended up modifying the index.js as detailed by @streusselhirni |
I found another workaround: You can set the touch-action via CSS and |
This is in fact really simple to do: Step 1: Add a ref to to your slider element: <div
ref="slider"
v-hammer:swipe.horizontal="onSwipe"
>
</div> Step 2: Use the export default {
mounted() {
this.$refs.slider.hammer.set({
touchAction: 'pan-y',
})
},
} @ptandler Yes this works by only setting CSS option, but support of this property is not really good (iOS > 13): https://caniuse.com/#search=touch-action |
Note to others: @sebj54 solution works on actual html elements, not vue components ;) (spend a few minutes figuring it out on a |
@paullacour You're right, if you set a ref on a Vue component you have to use |
I'm using a swipe left/right on an element that needs to scroll vertically. It seems that in order for this to work on iOS, I need to add the
touchAction
property to the manager. I'm a little unclear on how to do this. The README mentions two methods to configure recognizers, but doesn't go into detail on either.How would one add the
touchAction
property per the instructions at http://hammerjs.github.io/touch-action/The text was updated successfully, but these errors were encountered: