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

onSwipeStart only called once per element #39

Open
arondeparon opened this issue Jun 7, 2023 · 3 comments
Open

onSwipeStart only called once per element #39

arondeparon opened this issue Jun 7, 2023 · 3 comments

Comments

@arondeparon
Copy link
Contributor

Describe the bug
When using a trailing and leading action on a single element, onSwipeStart will only be called once.

To Reproduce
Steps to reproduce the behavior:

  1. Partially swipe right.
  2. Observe that onSwipeStart will trigger
  3. End swipe.
  4. Partially swipe left.
  5. Oberse that onSwipeStart will NOT trigger.

Expected behavior
onSwipeStart should trigger every time a new sequence is started.

Note: it does work when swiping on another SwipableListItem and afterwards returning to the original element.

@marekrozmus
Copy link
Owner

Hi @arondeparon - what do you mean in point 3? Do you release the click/touch or not?

I have tried here: https://marekrozmus.github.io/react-swipeable-list/ and when I go like this:

  1. Partially swipe right.
  2. onSwipeStart triggers
  3. End swipe (release the mouse or touch)
  4. Partially swipe left.
  5. onSwipeStart triggers.

@arondeparon
Copy link
Contributor Author

@marekrozmus the issue seems to occur only when swiping from a "locked" state (not sure what you call it?) to another "locked" state. It's a bit hard to describe, so I recorded a video showing the behavior.

CleanShot.2023-06-08.at.22.55.11.mp4

@marekrozmus
Copy link
Owner

Hi @arondeparon - what kind of case you need that specific behaviour?
I mean now it works that swipe start is triggered when user moves item beyond the threshold and the swipe end when user release mouse button.
If you enter the "locked" state you are still "inside the swipe" state.
I think that what we are missing here is the scenario when user is swiping from "locked" state in opposite direction.
Then it should go through initial state and then new swipe start with opposite direction should be triggered?

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

2 participants