Skip to content

Commit

Permalink
Merge pull request #1144 from romainruaud/fix_include-js-ie
Browse files Browse the repository at this point in the history
[Facet Search] Fixed bug in IE because of unsupported .includes #1102
  • Loading branch information
romainruaud authored Oct 17, 2018
2 parents 62da151 + 929458d commit eca766d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ define([
var isValidItem = true;
var itemTokens = this.slugify(item.label).split('-');
searchTokens.forEach(function(currentToken) {
if (!itemTokens.includes(currentToken)) {
if (itemTokens.indexOf(currentToken) === -1) {
isValidItem = false;
}
})
if (isValidItem && lastSearchToken) {
var ngrams = itemTokens.map(function(token) {return token.substring(0, lastSearchToken.length)});
isValidItem = ngrams.includes(lastSearchToken);
isValidItem = ngrams.indexOf(lastSearchToken) !== -1;
}
return isValidItem;
}.bind(this))
Expand Down

0 comments on commit eca766d

Please sign in to comment.