forked from Kieran/snort
Dont reset scroll on modal
This commit is contained in:
parent
1310c87438
commit
a697751f03
@ -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);
|
||||||
|
@ -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");
|
||||||
}, []);
|
}, []);
|
||||||
|
Loading…
Reference in New Issue
Block a user