Skip to content

[Help]: Disable mouse dragging while keeping touch dragging #1108

Closed Answered by sarussss
pepew-le-boss asked this question in Help
Discussion options

You must be logged in to vote

Hi @pepew-le-boss,

You can use the watchDrag option:

<Carousel
  opts={{
    watchDrag: (emblaApi, event) => {
      // The event parameter here is a TouchEvent or MouseEvent
      return 'TouchEvent' in window && event instanceof TouchEvent;
    },
  }}
>
  ...
</Carousel>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pepew-le-boss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
resolved This issue is resolved question Question about how to achieve something
2 participants