diff --git a/packages/fuselage/src/components/MultiSelect/MultiSelect.tsx b/packages/fuselage/src/components/MultiSelect/MultiSelect.tsx index 1f178ef048..8e5e539fac 100644 --- a/packages/fuselage/src/components/MultiSelect/MultiSelect.tsx +++ b/packages/fuselage/src/components/MultiSelect/MultiSelect.tsx @@ -10,6 +10,8 @@ import type { ElementType, Ref, ReactNode, + FocusEventHandler, + MouseEventHandler, } from 'react'; import React, { useState, useRef, useEffect, forwardRef } from 'react'; @@ -142,19 +144,29 @@ export const MultiSelect = forwardRef( }; const handleClick = useEffectEvent(() => { - if (visible === AnimatedVisibility.VISIBLE) { - return hide(); - } innerRef.current?.focus(); - return show(); }); + const handleBlur: FocusEventHandler = useEffectEvent(() => { + visible === AnimatedVisibility.VISIBLE && hide(); + }); + + const handleOnMouseDown = useEffectEvent((e) => { + const isClickOnChip = e.target.closest('.rcx-chip'); + if (!isClickOnChip) { + visible === AnimatedVisibility.VISIBLE ? hide() : show(); + } + }); + + const handleAnchorClick: MouseEventHandler = useEffectEvent(() => {}); + return (