File tree Expand file tree Collapse file tree
client/src/app/components/Autocomplete Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ export const Autocomplete: React.FC<IAutocompleteProps> = ({
7676 optionsNotSelected,
7777 removeSelectionById,
7878 handleOnSelect,
79+ handleOnCreateNewOption,
7980 handleInputChange,
8081 handleKeyDown,
8182 handleClearSearchInput,
@@ -150,10 +151,7 @@ export const Autocomplete: React.FC<IAutocompleteProps> = ({
150151 < SelectOption
151152 id = { createItemId ( "new-option" ) }
152153 isFocused = { true }
153- onClick = { ( ) => {
154- const newOption = onCreateNewOption ( inputValue ) ;
155- handleOnSelect ( newOption ) ;
156- } }
154+ onClick = { ( ) => handleOnCreateNewOption ( inputValue ) }
157155 > { `Create new option "${ inputValue } "` } </ SelectOption >
158156 ) : noResultsMessage && optionsNotSelected . length === 0 ? (
159157 < SelectOption isAriaDisabled > { noResultsMessage } </ SelectOption >
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ export const useAutocompleteHandlers = ({
176176 handleInputChange,
177177 handleKeyDown,
178178 handleOnSelect,
179+ handleOnCreateNewOption,
179180 menuRef,
180181 searchInputRef,
181182 removeSelectionById,
You can’t perform that action at this time.
0 commit comments