Skip to content

Commit

Permalink
Minor tweaks (datacommonsorg#4764)
Browse files Browse the repository at this point in the history
Stops triggering autocomplete for "the", and uses the location icon when
spaces at the start and end are the only difference between the current
query and matched query.
  • Loading branch information
gmechali authored Dec 5, 2024
1 parent 3bfa00a commit 496dd7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/routes/shared_api/autocomplete/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
'place_dcid': 'asia'
}] + TWO_WORD_CUSTOM_PLACES
SKIP_AUTOCOMPLETE_TRIGGER = [
"tell", "me", "show", "about", "which", "what", "when", "how"
"tell", "me", "show", "about", "which", "what", "when", "how", "the"
]

# Exceptions for the 3 letter trigger rule. These queries can trigger on only two letters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function AutoCompleteSuggestions(
const [triggered, setTriggered] = useState(false);

function getIcon(query: string, matched_query: string): string {
if (query == matched_query) {
if (query.trim() == matched_query.trim()) {
return "location_on";
}
return "search";
Expand Down

0 comments on commit 496dd7d

Please sign in to comment.