File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/block-library/src/dialog-element Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,16 @@ const { actions: privateActions, state: privateState } = store(
176176 if ( dialog . isOpen ) {
177177 return ;
178178 }
179+ // If already closing, don't start another close animation
180+ if ( dialog . isClosing ) {
181+ return ;
182+ }
183+ // Only proceed if the dialog element is actually open in the DOM
184+ // This prevents the watcher from triggering close animations when the dialog
185+ // was never opened in the first place (e.g., on page load when isOpen initializes to false)
186+ if ( ! dialogElement . open ) {
187+ return ;
188+ }
179189 // Start isClosing animation...
180190 privateState . dialogs [ id ] . isClosing = true ;
181191 // Allow for animation to complete...
You can’t perform that action at this time.
0 commit comments