summaryrefslogtreecommitdiffstats
path: root/public/javascripts/application.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts/application.js')
-rw-r--r--public/javascripts/application.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index c27be49ab..4db005b93 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1161,6 +1161,12 @@ function inlineAutoComplete(element) {
if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') {
$(element).attr('autocomplete', 'off');
}
+ // When triggered with text starting with "##", like "##a", the search term will become "#a",
+ // causing the SQL query to fail in finding issues with "a" in the subject.
+ // To avoid this, remove the first "#" from the search term.
+ if (text) {
+ text = text.replace(/^#/, '');
+ }
remoteSearch(getDataSource('issues') + encodeURIComponent(text), function (issues) {
return cb(issues);
});