Skip to content
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 on trackpad #2

Open
mig-hub opened this issue May 16, 2024 · 0 comments
Open

Swipe on trackpad #2

mig-hub opened this issue May 16, 2024 · 0 comments

Comments

@mig-hub
Copy link

mig-hub commented May 16, 2024

Hello, Thank you for the great work on this library.

I have specifically chosen your library because yours seems to handle swipe on devices that are not touch screens. I have made it work on touchscreens without any problem, but I struggle to make it work on my laptop. I have enabled the mouse I assume because I used it like this:

<div
    use:swipeable={{ trackMouse: true }}
    on:swipedleft={ goNext }
  on:swipedright={ goPrev }
  ...
>
  ...
</div>

It probably boils down to what I understand defines a swipe when you have a mouse, even more so a trackpad in my case. What I am trying to achieve, which is probably quite common with your library, is to have a slideshow that loops which is triggered on click. So I already have a click event which determines if it goes next or prev depending on which side of the slideshow was clicked. But I want it to work when visitors think they need to scroll instead. By adding the code above, it does work on touch screen. But not if I try to scroll on touchpad.

Maybe it's not really as easy as that because a trackpad is sort of in between and also the gesture people use to scroll is actually defined by the browser. In my case it is a scroll gesture with 2 fingers, but it could be different for somebody else. Therefore I thought the most appropriate route is still to detect a sort or scroll. But as far as I know, there is no such thing as a scroll event on something that does not technically scroll.

Anyway, I wanted to have your opinion on this and if you know a way to achieve what I am trying to achieve.

Thank you in advance.

Best,
Mickael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant