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 }) => {
|
onSuggestionSelected={(e, { suggestion }) => {
|
||||||
const valueWithoutLastWord =
|
const valueWithoutLastWord = query.value
|
||||||
query.value.match(/^(.*?)\s*\S+$/)?.[1] || query.value;
|
? query.value.match(/^(.*?)\s*\S+$/)[1]
|
||||||
|
: query.value;
|
||||||
onChange({
|
onChange({
|
||||||
...query,
|
...query,
|
||||||
value: valueWithoutLastWord,
|
value: valueWithoutLastWord,
|
||||||
|
|
Loading…
Reference in a new issue