Skip to content

Commit

Permalink
Merge afa37bc into c0963ac
Browse files Browse the repository at this point in the history
  • Loading branch information
rzyanhao authored Feb 24, 2021
2 parents c0963ac + afa37bc commit f6f4db1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/hooks/usePickerInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f6f4db1

Please sign in to comment.