Skip to content

Commit d8d917f

Browse files
committed
fix: Only run single modal close step
1 parent 32f6468 commit d8d917f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.changeset/rich-windows-admire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/headless': patch
3+
---
4+
5+
fix: Only run single modal close step

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ export function useModal() {
3131
},
3232
{ once: true },
3333
);
34-
}
35-
if (transitionDuration !== '0s') {
34+
} else if (transitionDuration !== '0s') {
3635
modal.addEventListener(
3736
'transitionend',
3837
(e) => {
@@ -45,8 +44,7 @@ export function useModal() {
4544
},
4645
{ once: true },
4746
);
48-
}
49-
if (animationDuration === '0s' && transitionDuration === '0s') {
47+
} else if (animationDuration === '0s' && transitionDuration === '0s') {
5048
delete modal.dataset.closing;
5149
modal.classList.remove('modal-closing');
5250
enableBodyScroll(modal);

0 commit comments

Comments
 (0)