Commit 3f5a72c2 authored by agusmakmun's avatar agusmakmun
Browse files

Fixing Match all strings input to lowercase

parent eda79095
......@@ -102,7 +102,7 @@
searchInputEl.addEventListener('input', function onInputChange() {
var currentResultHash, d;
currentInputValue = searchInputEl.value;
currentInputValue = (searchInputEl.value + '').toLowerCase();
if (!currentInputValue || currentInputValue.length < 3) {
lastSearchResultHash = '';
searchResultsEl.classList.add('is-hidden');
......@@ -111,7 +111,7 @@
searchResultsEl.style.offsetWidth;
var matchingPosts = posts.filter(function (post) {
if (post.title.indexOf(currentInputValue) !== -1 || post.description.indexOf(currentInputValue) !== -1) {
if ((post.title + '').toLowerCase().indexOf(currentInputValue) !== -1 || (post.description + '').toLowerCase().indexOf(currentInputValue) !== -1) {
return true;
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment