mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-20 01:56:33 +00:00
prevent bg scroll while modal open
This commit is contained in:
parent
0ed41b4957
commit
c04b8a24f9
@ -61,8 +61,10 @@ const Modal: FC<Props> = ({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflow = 'hidden';
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
return () => {
|
||||
document.body.style.overflow = 'unset';
|
||||
window.removeEventListener('keydown', handleKeyDown);
|
||||
};
|
||||
}, [handleKeyDown]);
|
||||
|
Loading…
Reference in New Issue
Block a user