diff --git a/src/hooks/usePickerInput.ts b/src/hooks/usePickerInput.ts index 318dca4c1..0d54e3fcf 100644 --- a/src/hooks/usePickerInput.ts +++ b/src/hooks/usePickerInput.ts @@ -112,7 +112,12 @@ export default function usePickerInput({ if (blurToCancel) { setTimeout(() => { - if (isClickOutside(document.activeElement)) { + let { activeElement } = document; + while (activeElement && activeElement.shadowRoot) { + activeElement = activeElement.shadowRoot.activeElement; + } + + if (isClickOutside(activeElement)) { onCancel(); } }, 0);