diff --git a/packages/dropdowns/src/elements/combobox/Combobox.tsx b/packages/dropdowns/src/elements/combobox/Combobox.tsx index 14f0dc2cc1..cd1b09b14d 100644 --- a/packages/dropdowns/src/elements/combobox/Combobox.tsx +++ b/packages/dropdowns/src/elements/combobox/Combobox.tsx @@ -176,48 +176,34 @@ export const Combobox = forwardRef( 'listboxAriaLabel', 'Options' ); - const triggerProps = { - isAutocomplete, - isBare, - isCompact, - isEditable, - isLabelHovered, - isMultiselectable, - maxHeight, - focusInset, - validation, - ...(getTriggerProps({ - onFocus: () => { - if (!isDisabled) { - if (isEditable) { - setIsInputHidden(false); - } + const triggerProps = getTriggerProps({ + onFocus: () => { + if (!isDisabled) { + if (isEditable) { + setIsInputHidden(false); + } - if (isMultiselectable) { - setIsTagGroupExpanded(true); - } + if (isMultiselectable) { + setIsTagGroupExpanded(true); + } + } + }, + onBlur: event => { + if (event.relatedTarget === null || !triggerRef.current?.contains(event.relatedTarget)) { + if (isEditable) { + setIsInputHidden(true); } - }, - onBlur: event => { - if (event.relatedTarget === null || !triggerRef.current?.contains(event.relatedTarget)) { - if (isEditable) { - setIsInputHidden(true); - } - if (isMultiselectable) { - setIsTagGroupExpanded(false); - } + if (isMultiselectable) { + setIsTagGroupExpanded(false); } } - }) as HTMLAttributes) - }; + } + }) as HTMLAttributes; + const inputProps = { 'aria-invalid': validation === 'error' || validation === 'warning', hidden: isInputHidden, - isBare, - isCompact, - isEditable, - isMultiselectable, placeholder, ...(getInputProps({ ...(_inputProps as IUseComboboxReturnValue['getInputProps']) @@ -266,12 +252,23 @@ export const Combobox = forwardRef( return ( - + {!!startIcon && ( @@ -291,7 +288,7 @@ export const Combobox = forwardRef(