diff --git a/ui-core/src/components/inputs/ComboBox/ComboBox.tsx b/ui-core/src/components/inputs/ComboBox/ComboBox.tsx index 208d9032..41aaa357 100644 --- a/ui-core/src/components/inputs/ComboBox/ComboBox.tsx +++ b/ui-core/src/components/inputs/ComboBox/ComboBox.tsx @@ -33,7 +33,7 @@ const ComboBox = ({ customLabel, numberOfSuggestionsToShow = 5, exactSearch = false, - value, + value = '', small, onSelectSuggestion, disableDefaultFilter = false, @@ -41,7 +41,7 @@ const ComboBox = ({ }: ComboBoxProps) => { const [filteredSuggestions, setFilteredSuggestions] = useState([]); const [activeSuggestionIndex, setActiveSuggestionIndex] = useState(-1); - const [inputValue, setInputValue] = useState(value || ''); + const [inputValue, setInputValue] = useState(value); const [selectedOption, setSelectedOption] = useState(null); const [isInputFocused, setIsInputFocused] = useState(false); @@ -84,7 +84,7 @@ const ComboBox = ({ }; const icons = [ - ...(selectedOption + ...(selectedOption || suggestions.some((suggestion) => getSuggestionLabel(suggestion) === value) ? [ { icon: , diff --git a/ui-core/src/stories/ComboBox.stories.tsx b/ui-core/src/stories/ComboBox.stories.tsx index b7c47c0b..70f70ab2 100644 --- a/ui-core/src/stories/ComboBox.stories.tsx +++ b/ui-core/src/stories/ComboBox.stories.tsx @@ -51,7 +51,7 @@ export const WithDefaultValue: Story = { args: { label: 'Your name', type: 'text', - value: 'Manuéla', + value: 'Manolo', }, };