From d86792ac552333170ed8aead836709ad23c4a395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Mon, 12 Apr 2021 13:24:14 +0200 Subject: [PATCH] feat(qs): append space to query on tap-ahead When using the tap-ahead pattern on Query Suggestions, it's common to insert a space after the suggestion so that users can keep typing without manually adding a space. --- .../src/createQuerySuggestionsPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/autocomplete-plugin-query-suggestions/src/createQuerySuggestionsPlugin.ts b/packages/autocomplete-plugin-query-suggestions/src/createQuerySuggestionsPlugin.ts index d1ce31958..96bc7dc7d 100644 --- a/packages/autocomplete-plugin-query-suggestions/src/createQuerySuggestionsPlugin.ts +++ b/packages/autocomplete-plugin-query-suggestions/src/createQuerySuggestionsPlugin.ts @@ -82,7 +82,7 @@ export function createQuerySuggestionsPlugin< return { getSources({ query, setQuery, refresh, state }) { function onTapAhead(item: TItem) { - setQuery(item.query); + setQuery(`${item.query} `); refresh(); }