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

Why are you tracking mousedown? #64

Closed
isaachinman opened this issue Oct 11, 2024 · 5 comments · Fixed by #65
Closed

Why are you tracking mousedown? #64

isaachinman opened this issue Oct 11, 2024 · 5 comments · Fixed by #65

Comments

@isaachinman
Copy link

Hey there. I've been on the hunt for a package like this, and in general think the behaviour you have achieved is fantastic.

However, I was surprised and disappointed to find that the swipe behaviour still activates on desktop/non touch devices. This is totally unexpected – normally this kind of swipe interaction only applies to mobile/touch devices, and should not even be listening for mousedown events.

I'm sure you had a good reason for doing so, but was also surprised to see that this behaviour is not configurable.

Is there any way to prevent the swipe handlers from listening on desktop/non-touch? Are you aware of any other alternative packages?

Thanks 🙏

@marekrozmus
Copy link
Owner

Hello :) I have no idea today - so I guess it is for historical reasons ;)
I can take a look on the weekend and prepare some version with that feature configurable.
This shouldn't be much work :)

@isaachinman
Copy link
Author

That would be fantastic – I was about to fork and start digging myself.

In general I think it would be most useful if this kind of package was a "hooks-only" kind of thing, where the user was responsible for constructing the UI completely on their own.

Besides that, at least having the ability to omit desktop environments would make it usable.

@marekrozmus
Copy link
Owner

This is pretty old package which I update sometimes with some small fixes. You can check the code that there is old stuff like componentDidMount ;) The first version was created like 5 years ago here: https://github.com/sandstreamdev/react-swipeable-list
Maybe some day I will do something about but actually there is not so many users that complain about it ;)

@marekrozmus
Copy link
Owner

@isaachinman Please check if this is what you need :) #65

@isaachinman
Copy link
Author

Yes, I have indeed already had an in-depth look at the source code, and am pondering rewriting it as hooks-only with react-swipeable as a sole dependency. If I do that I will let you know!

The PR looks fantastic, thanks for such a rapid fix 👌

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

Successfully merging a pull request may close this issue.

2 participants