Skip to content

Commit

Permalink
Fix Safari background scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
deoostfrees committed Nov 19, 2022
1 parent 962d67e commit 9a7071e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions dist/css/parvus.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
--parvus-loader-color: hsl(228, 24%, 23%);
}

.parvus-is-open {
touch-action: none;
}

/**
* Parvus trigger
*
Expand Down Expand Up @@ -59,6 +63,7 @@
justify-content: center;
line-height: 1.667;
overflow: hidden;
overscroll-behavior: contain;
position: fixed;
z-index: 1337;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/css/parvus.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/js/parvus.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ function Parvus(userOptions) {
}
});
lightbox.dispatchEvent(OPEN_EVENT);
document.body.classList.add('parvus-is-open');
};

/**
Expand Down Expand Up @@ -543,6 +544,7 @@ function Parvus(userOptions) {
}
});
lightbox.dispatchEvent(CLOSE_EVENT);
document.body.classList.remove('parvus-is-open');
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/js/parvus.esm.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/js/parvus.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@
}
});
lightbox.dispatchEvent(OPEN_EVENT);
document.body.classList.add('parvus-is-open');
};

/**
Expand Down Expand Up @@ -549,6 +550,7 @@
}
});
lightbox.dispatchEvent(CLOSE_EVENT);
document.body.classList.remove('parvus-is-open');
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/js/parvus.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/js/parvus.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ export default function Parvus (userOptions) {
})

lightbox.dispatchEvent(OPEN_EVENT)

document.body.classList.add('parvus-is-open')
}

/**
Expand Down Expand Up @@ -589,6 +591,8 @@ export default function Parvus (userOptions) {
})

lightbox.dispatchEvent(CLOSE_EVENT)

document.body.classList.remove('parvus-is-open')
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/scss/parvus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
--parvus-loader-color: hsl(228, 24%, 23%);
}

.parvus-is-open {
touch-action: none;
}

/**
* Parvus trigger
*
Expand Down Expand Up @@ -70,6 +74,7 @@
justify-content: center;
line-height: 1.667;
overflow: hidden;
overscroll-behavior: contain;
position: fixed;
z-index: 1337;

Expand Down

0 comments on commit 9a7071e

Please sign in to comment.