From 86aa9793101bb31a69f7ff491413c7af0f04a605 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 20 Oct 2016 09:13:09 -0400 Subject: Fix autocomplete not clearing suggestions properly (#4276) --- webapp/stores/suggestion_store.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/stores/suggestion_store.jsx b/webapp/stores/suggestion_store.jsx index c528f7360..75221421f 100644 --- a/webapp/stores/suggestion_store.jsx +++ b/webapp/stores/suggestion_store.jsx @@ -222,7 +222,8 @@ class SuggestionStore extends EventEmitter { switch (type) { case ActionTypes.SUGGESTION_PRETEXT_CHANGED: - if (other.pretext === '') { + // Clear the suggestions if the pretext is empty or has whitespace + if (other.pretext === '' || (/\s/g.test(other.pretext))) { this.clearSuggestions(id); } -- cgit v1.2.3-1-g7c22