File tree Expand file tree Collapse file tree
packages/core/src/FocusScope Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,6 +185,10 @@ watchEffect(async (cleanupFn) => {
185185 container .addEventListener (AUTOFOCUS_ON_UNMOUNT , unmountEventHandler )
186186 container .dispatchEvent (unmountEvent )
187187
188+ // Signal that blur events fired below are system-initiated (focus trap
189+ // cleanup), not user-initiated. Consumers can use this to skip validation.
190+ container .setAttribute (' data-focus-scope-unmounting' , ' ' )
191+
188192 setTimeout (() => {
189193 if (! unmountEvent .defaultPrevented )
190194 focus (previouslyFocusedElement ?? document .body , { select: true })
@@ -193,6 +197,7 @@ watchEffect(async (cleanupFn) => {
193197 container .removeEventListener (AUTOFOCUS_ON_UNMOUNT , unmountEventHandler )
194198
195199 focusScopesStack .remove (focusScope )
200+ container .removeAttribute (' data-focus-scope-unmounting' )
196201 }, 0 )
197202 })
198203})
You can’t perform that action at this time.
0 commit comments