huntabyte / vaul-svelte

An unstyled drawer component for Svelte.
https://vaul-svelte.com
MIT License
419 stars 17 forks source link

Requires Double Click to Reopen After Swipe Close #5

Closed PrabhuKiran8790 closed 8 months ago

PrabhuKiran8790 commented 8 months ago

Issue Description:

On mobile devices, when I swipe it down to close, I can't reopen it by clicking the button just once; instead, I need to click the button twice. This behavior is inconsistent with the expected behavior, where the drawer should open again with a single click after being closed by swiping down.

Steps to Reproduce:

  1. Open the drawer by clicking the button.
  2. Swipe the drawer down to close it.
  3. Attempt to reopen the drawer by clicking the button.

Expected Behavior:

The drawer should reopen with a single click after being closed by swiping down.

Actual Behavior:

The drawer requires two clicks to reopen after being closed by swiping down or need to click outside to enable the button.

PrabhuKiran8790 commented 8 months ago

https://github.com/huntabyte/vaul-svelte/assets/86601758/55355c96-d6ee-4c2f-b0e9-9f9025d04936

JamieDW commented 8 months ago

Thanks PrabhuKiran8790, I also noticed this. One thing I found is If you swipe all the way down this doesn't happen. I have a feeling it may be the invisible overlay?

screen-20231231-230735.webm

PrabhuKiran8790 commented 8 months ago

Yes Jamie! This doesn't happen if you swipe all the way down. Maybe an invisible overlay or an issue with swipe down gesture.

basokant commented 8 months ago

@PrabhuKiran8790 I believe that you should not be able to reopen the drawer until the drawer is completely closed. The double click behaviour that you noticed is just a result of the animation taking longer than you expect. You are right about the overlay, it only unmounts when the drawer is completely closed.

huntabyte commented 8 months ago

This is likely something that the user would be able to handle on the UI side, which could be disabling the button while the open state of the drawer is true. I suppose we could also disable the button while it's open but it would ultimately be up to the dev to ensure it visually appears disabled so the user doesn't try to click it again.

PrabhuKiran8790 commented 8 months ago

I just noticed that the animation takes a little longer and I can reopen the drawer without the double click. I'm closing this issue. Great work @huntabyte.