diff --git a/client/src/app/components/SimpleSelectTypeahead.tsx b/client/src/app/components/SimpleSelectTypeahead.tsx index c442c5149d..3e61aea324 100644 --- a/client/src/app/components/SimpleSelectTypeahead.tsx +++ b/client/src/app/components/SimpleSelectTypeahead.tsx @@ -25,7 +25,9 @@ export interface ISimpleSelectBasicProps { toggleId?: string; toggleAriaLabel?: string; selectMultiple?: boolean; + width?: number; noResultsFoundText?: string; + hideClearButton?: boolean; } export const SimpleSelectTypeahead: React.FC = ({ @@ -37,7 +39,9 @@ export const SimpleSelectTypeahead: React.FC = ({ toggleId, toggleAriaLabel, selectMultiple = false, + width, noResultsFoundText, + hideClearButton = false, }) => { const [isOpen, setIsOpen] = React.useState(false); const [selected, setSelected] = React.useState( @@ -190,7 +194,8 @@ export const SimpleSelectTypeahead: React.FC = ({ variant="typeahead" onClick={onToggleClick} isExpanded={isOpen} - isFullWidth + isFullWidth={!width} + style={{ width: width && width + "px" }} > = ({ onChange={onTextInputChange} onKeyDown={onInputKeyDown} onBlur={() => { - setInputValue(""); + selectMultiple + ? setInputValue("") + : setInputValue(selected.toString()); }} id="typeahead-select-input" autoComplete="off" @@ -243,7 +250,7 @@ export const SimpleSelectTypeahead: React.FC = ({ )} - {!selectMultiple && !!inputValue && ( + {!hideClearButton && !selectMultiple && !!inputValue && (