File tree 1 file changed +10
-2
lines changed
packages/kit-headless/src/components/modal
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -53,18 +53,26 @@ export const HModalPanel = component$((props: PropsOf<'dialog'>) => {
53
53
54
54
await showModal ( panelRef . value ) ;
55
55
window . requestAnimationFrame = storedRequestAnimationFrame ;
56
- await context . onShow$ ?.( ) ;
57
56
activateFocusTrap ( focusTrap ) ;
58
57
} else {
59
58
await closeModal ( panelRef . value ) ;
60
- await context . onClose$ ?.( ) ;
61
59
}
62
60
63
61
cleanup ( async ( ) => {
64
62
await deactivateFocusTrap ( focusTrap ) ;
65
63
} ) ;
66
64
} ) ;
67
65
66
+ useTask$ ( async ( { track } ) => {
67
+ track ( ( ) => context . showSig . value ) ;
68
+
69
+ if ( context . showSig . value ) {
70
+ await context . onShow$ ?.( ) ;
71
+ } else {
72
+ await context . onClose$ ?.( ) ;
73
+ }
74
+ } ) ;
75
+
68
76
const closeOnBackdropClick$ = $ ( async ( e : MouseEvent ) => {
69
77
if ( context . alert === true || context . closeOnBackdropClick === false ) {
70
78
return ;
You can’t perform that action at this time.
0 commit comments