Oops, fix bug where suggestion didn't remove word
This commit is contained in:
parent
2a08aa5ce9
commit
539a6bd740
1 changed files with 3 additions and 2 deletions
|
@ -192,8 +192,9 @@ function SearchToolbar({
|
|||
}
|
||||
}}
|
||||
onSuggestionSelected={(e, { suggestion }) => {
|
||||
const valueWithoutLastWord =
|
||||
query.value.match(/^(.*?)\s*\S+$/)?.[1] || query.value;
|
||||
const valueWithoutLastWord = query.value
|
||||
? query.value.match(/^(.*?)\s*\S+$/)[1]
|
||||
: query.value;
|
||||
onChange({
|
||||
...query,
|
||||
value: valueWithoutLastWord,
|
||||
|
|
Loading…
Reference in a new issue