File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/kit-headless/src/components/modal Expand file tree Collapse file tree 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'>) => {
5353
5454 await showModal ( panelRef . value ) ;
5555 window . requestAnimationFrame = storedRequestAnimationFrame ;
56- await context . onShow$ ?.( ) ;
5756 activateFocusTrap ( focusTrap ) ;
5857 } else {
5958 await closeModal ( panelRef . value ) ;
60- await context . onClose$ ?.( ) ;
6159 }
6260
6361 cleanup ( async ( ) => {
6462 await deactivateFocusTrap ( focusTrap ) ;
6563 } ) ;
6664 } ) ;
6765
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+
6876 const closeOnBackdropClick$ = $ ( async ( e : MouseEvent ) => {
6977 if ( context . alert === true || context . closeOnBackdropClick === false ) {
7078 return ;
You can’t perform that action at this time.
0 commit comments