Don't remove word from query in Advanced Search
Oops, we were removing the last word of the search query if you picked a suggestion from Advanced Search! That behavior is meant for the case where you're _typing_ a filter name 😅
This commit is contained in:
parent
a527d44e12
commit
fca3ccf0a0
1 changed files with 5 additions and 1 deletions
|
@ -195,7 +195,11 @@ function SearchToolbar({
|
||||||
onSuggestionSelected={(e, { suggestion }) => {
|
onSuggestionSelected={(e, { suggestion }) => {
|
||||||
onChange({
|
onChange({
|
||||||
...query,
|
...query,
|
||||||
value: removeLastWord(query.value),
|
// If the suggestion was from typing, remove the last word of the
|
||||||
|
// query value. Or, if it was from Advanced Search, leave it alone!
|
||||||
|
value: advancedSearchIsOpen
|
||||||
|
? query.value
|
||||||
|
: removeLastWord(query.value),
|
||||||
filterToZoneLabel: suggestion.zoneLabel || query.filterToZoneLabel,
|
filterToZoneLabel: suggestion.zoneLabel || query.filterToZoneLabel,
|
||||||
filterToItemKind: suggestion.itemKind || query.filterToItemKind,
|
filterToItemKind: suggestion.itemKind || query.filterToItemKind,
|
||||||
filterToCurrentUserOwnsOrWants:
|
filterToCurrentUserOwnsOrWants:
|
||||||
|
|
Loading…
Reference in a new issue