Skip to content

Commit db9be52

Browse files
authored
Fix the issue with Chrome > 126 blurring when focusing on child elements (#631)
1 parent 6f68ade commit db9be52

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/MultiSelect/index.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ export default function MultiSelect<K, V>(props: MultiSelectProps<K, V>): JSX.El
6868
}
6969
}, [optionsVisible]);
7070

71-
const onBlurHandler = () => {
71+
const onBlurHandler = (event: any) => {
72+
// In Chrome > 126, the onBlur event will fire even if you are clicking _within_ the focused element
73+
// If this is the case, we do not actually want to blur
74+
if (event.currentTarget.contains(event.relatedTarget)) {
75+
return;
76+
}
77+
7278
setOpenedOptions(false);
7379

7480
if (props.onBlur) {

0 commit comments

Comments
 (0)