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

Body background not reset on drawer close #188

Closed
andrewdoro opened this issue Dec 26, 2023 · 5 comments
Closed

Body background not reset on drawer close #188

andrewdoro opened this issue Dec 26, 2023 · 5 comments

Comments

@andrewdoro
Copy link

https://github.com/emilkowalski/vaul/blob/25e4999b0afd92b4b47d35a6a56cb16074610ce8/src/index.tsx#L394C1-L395C1
Using 0.8

Steps to reproduce

  1. Go to https://vaul.emilkowal.ski/
  2. Open drawer and then close it
  3. Look at the body tag styles, background is still set to black
Screenshot 2023-12-26 at 16 00 08
@yigityalim
Copy link

Yes! This issue needs to be resolved quickly!

@dseiner
Copy link

dseiner commented Dec 28, 2023

I'm facing the same issue, but it only occurs when I add the "vaul-drawer-wrapper" div.

<div data-vaul-drawer-wrapper="">
{children}
</div>

The problem does not arise when I don't use the scale background feature; then the background color resets upon drawer close. However, I want to use this feature/effect.

As a workaround, I've used:

<div data-vaul-drawer-wrapper="" className="bg-background min-h-[100vh]">
{children}
</div>

This way, the background color remains the default instead of being replaced by black, as injected by the drawer. But still not an optimal solution.

@Mittsuyama
Copy link

This works for me:

<Drawer onClose={() => document.body.style.background = ''}>
  {/* ... */}
</Drawer>

@choeqq
Copy link
Contributor

choeqq commented Jan 27, 2024

solved it here:
#232

@emilkowalski
Copy link
Owner

Fixed in #232.

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

6 participants