Skip to content

Commit

Permalink
Merge pull request #86 from transverse-dev/development
Browse files Browse the repository at this point in the history
🚀 Production: 0.0.76 - hotfix modal 버그 수정
  • Loading branch information
ardor1104 authored Sep 8, 2022
2 parents 182a4a6 + b986e4e commit 662ea08
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 46 deletions.
3 changes: 3 additions & 0 deletions docs/commons.36a20d0df26ed08ca82a.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/commons.8484fe3c826c739133e1.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><base href="https://transverse-dev.github.io/evoui/"/><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>EvoUI</title><script>!function(n){if("/"===n.search[1]){var a=n.search.slice(1).split("&").map((function(n){return n.replace(/~and~/g,"&")})).join("?");window.history.replaceState(null,null,n.pathname.slice(0,-1)+a+n.hash)}}(window.location)</script><script defer="defer" src="./framework.1c173ba7ebbb319e202f.js"></script><script defer="defer" src="./commons.8484fe3c826c739133e1.js"></script><script defer="defer" src="./main.f41d31e82ee5bdef6fab.js"></script></head><body><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><base href="https://transverse-dev.github.io/evoui/"/><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>EvoUI</title><script>!function(n){if("/"===n.search[1]){var a=n.search.slice(1).split("&").map((function(n){return n.replace(/~and~/g,"&")})).join("?");window.history.replaceState(null,null,n.pathname.slice(0,-1)+a+n.hash)}}(window.location)</script><script defer="defer" src="./framework.1c173ba7ebbb319e202f.js"></script><script defer="defer" src="./commons.36a20d0df26ed08ca82a.js"></script><script defer="defer" src="./main.c50b9ed266f22906b40c.js"></script></head><body><div id="root"></div></body></html>

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions src/evoui/components/Modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ export default function Modal({

const [alreadyHidden, setAlreadyHidden] = useState<boolean>(false);

const keypressEvent = (e: KeyboardEvent) => {
if (e.code === 'Escape') {
onClose();
}
};

useEffect(() => {
if (window.document.body.style.overflow === 'hidden' && !alreadyHidden) {
setAlreadyHidden(true);
Expand All @@ -199,17 +205,14 @@ export default function Modal({
}

return () => {
if (!alreadyHidden) {
window.document.body.style.overflow = '';
}
setAlreadyHidden(false);
window?.removeEventListener('keydown', keypressEvent);
};
}, [isOpen]);

const keypressEvent = (e: KeyboardEvent) => {
if (e.code === 'Escape') {
onClose();
}
};

return isOpen ? (
<RootWrapper
isBackgroundOff={!!options?.RootBackgroundOff}
Expand Down

0 comments on commit 662ea08

Please sign in to comment.