Code Monkey home page Code Monkey logo

Comments (8)

tilleps avatar tilleps commented on May 23, 2024 15

Applying options on the element appears to also work:

<a
  v-touch:swipe="onSwipe"
  v-touch-options:swipe="{ direction: 'horizontal' }">
</a>

from vue-touch.

tilleps avatar tilleps commented on May 23, 2024 12

I might have I figured it out:

VueTouch.config.swipe = {
  direction: 'horizontal'
};
Vue.use(VueTouch);

http://hammerjs.github.io/recognizer-swipe/

When calling Hammer() to create a simple instance, the pan and swipe recognizers are configured to only detect horizontal gestures.

from vue-touch.

yyx990803 avatar yyx990803 commented on May 23, 2024

Probably related: http://hammerjs.github.io/touch-action/

from vue-touch.

BrandonSurowiec avatar BrandonSurowiec commented on May 23, 2024

@Johnathan @yyx990803 Did you figure out a solution? I know the touch-action should be set to pan-y but I haven't figured out how to pass that into the element to override. Looks like options.behavior.touchAction is what needs to be set.

from vue-touch.

Johnathan avatar Johnathan commented on May 23, 2024

I didn't. I ended up just changing the "panel" that could be swiped. Not ideal but something I can look at later on.

from vue-touch.

andredewaard avatar andredewaard commented on May 23, 2024

Is there a fix for this now?

from vue-touch.

JamieBunyassi avatar JamieBunyassi commented on May 23, 2024

For vue-touch@next the following works
v-on:swipeleft="swipeLeft" v-on:swiperight="swipeRight" v-bind:swipe-options="{ direction: 'horizontal' }"

from vue-touch.

nbursa avatar nbursa commented on May 23, 2024
  1. Make v-touch component empty sibling element to its content.
  2. Position it absolutely full screen and add CSS pointer-events: none
  3. Add to it tap event listener and toggle hide only on tap
  4. On underlying content add CSS pointer-events: all and toggle show v-touch on tap.

from vue-touch.

Related Issues (20)

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.