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

Drawer modal not hiding on resize #302

Open
gtandes opened this issue Mar 17, 2024 · 1 comment
Open

Drawer modal not hiding on resize #302

gtandes opened this issue Mar 17, 2024 · 1 comment

Comments

@gtandes
Copy link

gtandes commented Mar 17, 2024

Good day. I am trying to make Drawer display only on mobile screens and hide it if the user manually resizes their screen to 450px+.

Is that possible? If so, what property / properties do I need to change?

@mrnmilutinovic
Copy link

@gtandes I believe what you described is not the responsibility of Vaul.

On the other hand you should be able to solve this by conditionally rendering your components, or perhaps rendering something else when on desktop/mobile.

You could use something like useMediaQuery hook (check that here) to determine is you are on mobile and render based on that. Here is the working version of the on shadcn

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