From b4c29a9f3bdb68fc13b39a2303c9728fc5130cf5 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 14 Oct 2014 18:22:44 +1100 Subject: [PATCH] FIX: regression in autocomplete --- app/assets/javascripts/discourse/lib/autocomplete.js.es6 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 index 03f91d508..a79d76c99 100644 --- a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 +++ b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 @@ -261,10 +261,8 @@ export default function(options) { $(this).keypress(function(e) { var caretPosition, term; - if (!options.key) return; - // keep hunting backwards till you hit a the @ key - if (e.which === options.key.charCodeAt(0)) { + if (options.key && e.which === options.key.charCodeAt(0)) { caretPosition = Discourse.Utilities.caretPosition(me[0]); var prevChar = me.val().charAt(caretPosition - 1); if (!prevChar || /\s/.test(prevChar)) {