diff options
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_utils.js.es6 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 b/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 index df4103b0e7f..f5d2eb9ae76 100644 --- a/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 +++ b/app/assets/javascripts/filtered_search/dropdown_utils.js.es6 @@ -91,6 +91,7 @@ inputValue = inputValue.replace(/"(.*?)"/g, str => str.replace(/\s/g, '_') ); // Get the right position for the word selected + // Regex matches first space let right = inputValue.slice(selectionStart).search(/\s/); if (right >= 0) { @@ -100,6 +101,7 @@ } // Get the left position for the word selected + // Regex matches last non-whitespace character let left = inputValue.slice(0, right).search(/\S+$/); if (selectionStart === 0) { |