Skip to content

Commit

Permalink
VEES-20 | Fix overflow modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Melior committed Jan 13, 2025
1 parent 4dbb4fc commit 52e5872
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/shared/ui/Modal/ui/Base/base.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
}

body[data-closing="true"] {
body[data-modal-closed="true"] {
/* stylelint-disable-next-line no-descending-specificity */
.title, .action {
opacity: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/shared/ui/Modal/ui/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export const Modal = ({
const openModal = useCallback(() => {
setMount(true);

body?.setAttribute('data-closing', 'false');
body?.setAttribute('data-modal-closed', 'false');
}, [body]);

const closeModal = useCallback(() => {
onClose?.();

body?.setAttribute('data-closing', 'true');
body?.setAttribute('data-modal-closed', 'true');

setTimeout(() => {
setMount(false);
Expand Down
4 changes: 2 additions & 2 deletions src/shared/ui/Modal/ui/Modal/modal.global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
}

body {
&[data-closing="false"] {
&:has(#modal-root > *) {
overflow: hidden;
}

&[data-closing="true"] {
&[data-modal-closed="true"] {
.overlay {
opacity: 0;
}
Expand Down

0 comments on commit 52e5872

Please sign in to comment.