Skip to content

Commit

Permalink
trim values before searching
Browse files Browse the repository at this point in the history
  • Loading branch information
megumiimai committed Sep 2, 2023
1 parent 939e94b commit 4422633
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,10 @@

this.$searchbox.on('input propertychange', function () {
var searchValue = that.$searchbox[0].value;
var isWhitespace = /^\s*$/.test(searchValue);
if (!isWhitespace) {
searchValue = searchValue.replace(/^\s+|\s+$/g, '');

Check failure on line 2956 in js/bootstrap-select.js

View workflow job for this annotation

GitHub Actions / Node 14 test

Expected indentation of 10 spaces but found 12

Check failure on line 2956 in js/bootstrap-select.js

View workflow job for this annotation

GitHub Actions / Node 16 test

Expected indentation of 10 spaces but found 12
}

that.selectpicker.search.elements = [];
that.selectpicker.search.data = [];
Expand Down

0 comments on commit 4422633

Please sign in to comment.