Dont reset scroll on modal

This commit is contained in:
Kieran 2023-01-08 20:41:26 +00:00
parent 1310c87438
commit a697751f03
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,7 @@
.modal { .modal {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
position: absolute; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
background-color: rgba(0,0,0, 0.8); background-color: rgba(0,0,0, 0.8);

View File

@ -5,7 +5,6 @@ export default function Modal(props) {
const onClose = props.onClose || (() => {}); const onClose = props.onClose || (() => {});
useEffect(() => { useEffect(() => {
window.scrollTo(0, 0);
document.body.classList.add("scroll-lock"); document.body.classList.add("scroll-lock");
return () => document.body.classList.remove("scroll-lock"); return () => document.body.classList.remove("scroll-lock");
}, []); }, []);