Skip to content

Commit

Permalink
cleanup bg on body (#232)
Browse files Browse the repository at this point in the history
* cleanup bg on body

* use reset helper

* change original body styles
  • Loading branch information
choeqq authored Jan 31, 2024
1 parent e92a5ba commit c5c4579
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function Root({
}, 300);

setTimeout(() => {
reset(document.documentElement, 'scrollBehavior');
// reset(document.documentElement, 'scrollBehavior');
if (snapPoints) {
setActiveSnapPoint(snapPoints[0]);
}
Expand Down Expand Up @@ -581,6 +581,11 @@ function Root({
if (!wrapper || !shouldScaleBackground) return;

if (open) {
// setting original styles initially
set(document.body, {
background: document.body.style.backgroundColor || document.body.style.background,
});
// setting body styles, with cache ignored, so that we can get correct original styles in reset
set(
document.body,
{
Expand Down

0 comments on commit c5c4579

Please sign in to comment.