diff --git a/src/hooks/useFocusWithin/useFocusWithin.ts b/src/hooks/useFocusWithin/useFocusWithin.ts index 46e2185d02..c92f69cf35 100644 --- a/src/hooks/useFocusWithin/useFocusWithin.ts +++ b/src/hooks/useFocusWithin/useFocusWithin.ts @@ -96,6 +96,17 @@ export function useFocusWithin(props: UseFocusWithinProps) { return; } + if ( + document.activeElement === event.target && + (event.target instanceof HTMLButtonElement || + event.target instanceof HTMLInputElement || + event.target instanceof HTMLTextAreaElement || + event.target instanceof HTMLSelectElement) && + !event.target.disabled + ) { + return; + } + isFocusWithinRef.current = false; if (onBlurWithin) {