-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
Setting dismissable=false and modal=false still triggers the component to close #164
Comments
Hmm yeah, I've noticed the drawer doesn't necessarily adhere to the value passed via the Is this intended behavior? It's possible I've overlooked something. |
I just ran into this issue as well - I think that the problem is that the underlying Radix dialog's diff --git a/src/index.tsx b/src/index.tsx
index 891a0a8..65389a2 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -613,6 +613,11 @@ function Root({
<DialogPrimitive.Root
modal={modal}
onOpenChange={(o: boolean) => {
+ // Defer to open prop if explicitly set
+ if (openProp !== undefined) {
+ return;
+ }
+
if (!o) {
closeDrawer();
} else { |
+1, I would expect the the |
Controlled state issue has been fixed in #166. |
With the setup you provided the drawer doesn't close for me upon interacting with the background. Can you provide a codesandbox demo of this issue? |
@emilkowalski here is a codesandbox demo:
Desired behavior Current behavior The actual implementation I want is similar to Google Maps bottom sheet on mobile. If i click on two points, I want it the sheet to stay open, but the content inside to switch. Google Maps example: After you make the change can you add an example codepen with the correct props to cover this use case? Cheers mate! Beautiful repo and thank you for open sourcing this |
@emilkowalski one last thing, when will #166 get released on NPM? |
@xih did this fix work for you guys? |
@IsaiahHarris yep it works! @emilkowalski thank you for being on top of it! 🥰 the beauty of open-source =)) |
@xih what props did you use? It's not working for me in the latest version |
@xih I see, you don't have snap points. If you add snap points you're able to dismiss it |
here are my props
let me know if you have any issues! |
@xih what version are you on? I can still close the drawer with those props and dismissible={false} on 0.7.9 |
@xih your props that you posted does not have dismissible={false}. What does your onClose function look like? |
Here is the behavior that I am seeing
https://github.com/emilkowalski/vaul/assets/8076886/fb058903-fa8a-49b8-bc4b-739369be16eb
BEST CASE: what i want to happen is:
MID CASE:
CURRENT CASE:
How I"m calling the Bottomsheet:
The text was updated successfully, but these errors were encountered: