From 726d81f83b321acb032b009e2e01b8a13f8a22c4 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 5 Feb 2016 16:47:47 +0800 Subject: [PATCH] FIX: Don't update autocomplete when removing the key. --- app/assets/javascripts/discourse/lib/autocomplete.js.es6 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 index 5aa01e495b1..aeb2ffb1db9 100644 --- a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 +++ b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 @@ -430,6 +430,10 @@ export default function(options) { term = me.val().substring(completeStart + (options.key ? 1 : 0), caretPosition); + if ((completeStart === caretPosition) && (term === options.key)) { + closeAutocomplete(); + } + updateAutoComplete(options.dataSource(term)); return true; default: