Skip to content

Commit 5ebf5d9

Browse files
Gregor WoiwodeGregOnNet
authored andcommitted
fix(modal): prevent closing from being executed twice
1 parent 74b3fe8 commit 5ebf5d9

File tree

1 file changed

+1
-3
lines changed
  • packages/kit-headless/src/components/modal

1 file changed

+1
-3
lines changed

packages/kit-headless/src/components/modal/modal.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ export const Modal = component$((props: ModalProps) => {
6666
// fixes modal scrollbar flickering
6767
modal.style.left = `${scrollbarWidth}px`;
6868

69-
closing(modal, props.onClose$);
70-
7169
showSig.value = false;
7270
}
7371
};
@@ -82,10 +80,10 @@ export const Modal = component$((props: ModalProps) => {
8280
lockScroll();
8381
} else {
8482
unlockScroll(scrollbarWidth);
85-
closing(modal, props.onClose$);
8683
}
8784

8885
cleanup(() => {
86+
closing(modal, props.onClose$);
8987
deactivateFocusTrap(focusTrap);
9088

9189
// prevents closing animation scrollbar flickers (chrome & edge)

0 commit comments

Comments
 (0)