diff --git a/src/state/models/ui/tags-autocomplete.ts b/src/state/models/ui/tags-autocomplete.ts index 1f13004d47..ef5c6002d8 100644 --- a/src/state/models/ui/tags-autocomplete.ts +++ b/src/state/models/ui/tags-autocomplete.ts @@ -4,10 +4,6 @@ import {RootStoreModel} from '../root-store' import Fuse from 'fuse.js' import {isObj, hasProp, isStrArray} from 'lib/type-guards' -function uniq(arr: string[]) { - return Array.from(new Set(arr)) -} - /** * Used only to persist recent tags across app restarts. * @@ -100,7 +96,7 @@ export class TagsAutocompleteModel { // search amongst mixed set of tags const results = fuse.search(this.query).map(r => r.item) // backfill again in case search has no results - return uniq([...results, ...items]).slice(0, 9) + return results.slice(0, 9) } async search(query: string) { diff --git a/src/view/com/composer/TagInput/index.web.tsx b/src/view/com/composer/TagInput/index.web.tsx index 0b5c332bb4..7867430e04 100644 --- a/src/view/com/composer/TagInput/index.web.tsx +++ b/src/view/com/composer/TagInput/index.web.tsx @@ -120,6 +120,7 @@ export function TagInput({ if (key === 'Backspace' && value === '') { addTags(tags.slice(0, -1)) + closeDropdownAndReset() } else if (key === ' ') { e.preventDefault() // prevents an additional space on web addTagAndReset(value)