diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.js index 10f95da62c..7d9df5d7de 100644 --- a/frontend_tests/node_tests/composebox_typeahead.js +++ b/frontend_tests/node_tests/composebox_typeahead.js @@ -59,6 +59,8 @@ global.people.add({ assert_typeahead_equals("test @", false); assert_typeahead_equals("test no@o", false); assert_typeahead_equals("test :-P", false); + assert_typeahead_equals("test # a", false); + assert_typeahead_equals("test #", false); var all_items = [ { diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js index 5d248fea87..e041daf193 100644 --- a/static/js/composebox_typeahead.js +++ b/static/js/composebox_typeahead.js @@ -289,6 +289,11 @@ exports.compose_content_begins_typeahead = function (query) { return false; } + // Don't autocomplete if there is a space following a '#' + if (current_token[0] === " ") { + return false; + } + this.completing = 'stream'; this.token = current_token.substring(current_token.indexOf("#")+1); return stream_data.subscribed_subs();