Skip to content

Commit

Permalink
fix: don't apply body styles if there's no wrapper (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Sep 16, 2024
1 parent e2941a4 commit a7097a4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/use-scale-background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export function useScaleBackground() {
(document.querySelector('[data-vaul-drawer-wrapper]') as HTMLElement) ||
(document.querySelector('[vaul-drawer-wrapper]') as HTMLElement);

if (!wrapper) return;

const bodyAndWrapperCleanup = chain(
setBackgroundColorOnScale && !noBodyStyles ? assignStyle(document.body, { background: 'black' }) : noop,
assignStyle(wrapper, {
Expand Down

0 comments on commit a7097a4

Please sign in to comment.