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

[BUG] fastSwipeClose should clear this.steps before returning #180

Closed
rgoldiez opened this issue May 18, 2022 · 2 comments
Closed

[BUG] fastSwipeClose should clear this.steps before returning #180

rgoldiez opened this issue May 18, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rgoldiez
Copy link

rgoldiez commented May 18, 2022

Describe the bug
We have a pane with all three breakpoints set. fastSwipeClose={true} is also set. When the pane is presented and the user interacts with content on the pane (tap to focus on an input field, tap somewhere else, etc) and then swipes down from the top to dismiss, the pane closes (as expected) but subsequent presentation of the pane immediately dismiss on the first interaction (tapping on the content).

To Reproduce
Steps to reproduce the behavior (see code pen example below):

  1. Create a pane with all 3 break points
  2. Make sure fastSwipeClose={true} is set
  3. Present the pane to the middle or top break and engage with the contents of the pane (click in the content area)
  4. Fast swipe to close from the top area of the pane and the pane closes
  5. Present the pane again and click in the content area again
  6. Pane immediately closes on first touch

Expected behavior
Pane should only close by fast swiping, not by merely touching after a fast swipe has completed.

Additional context
I believe the issue can be found in this if condition which returns on a fastSwipeClose. If the steps array was cleared before returning, the issue I'm experiencing goes away. https://github.com/roman-rr/cupertino-pane/blob/07f9d74cac5f71fd1bee10fa49a9b2b8280054f1/src/events.ts#L366

Here's a code pen demonstrating the issue:
https://codepen.io/rgoldiez/pen/wvydzja

@roman-rr roman-rr added the bug Something isn't working label May 24, 2022
@roman-rr
Copy link
Collaborator

@rgoldiez should be fixed at master.

@rgoldiez
Copy link
Author

@roman-rr - works great..... thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants