Skip to content

Commit

Permalink
chore(react-components): show "search value" in Autocomplete create b…
Browse files Browse the repository at this point in the history
…utton
  • Loading branch information
donskov committed Sep 10, 2024
1 parent ccc6b30 commit fa5994a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-components/src/Autocomplete/autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ Multiple extends boolean | undefined = false,
})}
</AutocompleteDropdownList>
)}
{allowCreateOption && !loading && (
{(allowCreateOption && searchValue.length > 0 && !loading) && (
<Box
borderColor="gray-3"
borderPosition="top"
Expand All @@ -603,7 +603,7 @@ Multiple extends boolean | undefined = false,
onClick={handleCreate}
startIcon={<PlusIcon />}
>
{createOptionText}
{createOptionText.replace('{{value}}', searchValue)}
</AutocompleteCreateNewButton>
</Box>
)}
Expand All @@ -621,6 +621,6 @@ Autocomplete.defaultProps = {
limitTags: 2,
required: false,
allowCreateOption: false,
createOptionText: 'Create new',
createOptionText: 'Create "{{value}}"',
size: 'medium',
};

0 comments on commit fa5994a

Please sign in to comment.