diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-21 22:30:51 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-01-21 23:05:02 +0300 |
commit | e75c20fcff87f8f0de8daa556e7286659f111ab6 (patch) | |
tree | f6b9f78e77142ee8aed4c03f2c68cf609dddd485 /app | |
parent | 317ef7b51c680503b01c88b8d8fdb09bd1a515e8 (diff) |
Fixed issue with multiple words not filtering correctly
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_utils.js.es6 | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 b/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 index 6910cf171d4..443ac222f70 100644 --- a/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 +++ b/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 @@ -28,10 +28,7 @@ if (lastToken !== searchToken) { const title = updatedItem.title.toLowerCase(); let value = lastToken.value.toLowerCase(); - - if ((value[0] === '"' || value[0] === '\'') && title.indexOf(' ') !== -1) { - value = value.slice(1); - } + value = value.replace(/"(.*?)"/g, str => str.slice(1).slice(0, -1)); // Eg. filterSymbol = ~ for labels const matchWithoutSymbol = lastToken.symbol === filterSymbol && title.indexOf(value) !== -1; |