Skip to content

Commit 80c146a

Browse files
Lauren BrabbinLauren Brabbin
authored andcommitted
making search feature not case sensitive
1 parent c5ec9ee commit 80c146a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
return this.articles;
3232
}
3333
matchingKeyword = (article) => {
34-
if (article.title.includes(this.keyword)) {
34+
if (article.title.toLowerCase().includes(this.keyword.toLowerCase())) {
3535
this.relevantArticles.push(article);
3636
}
3737
};

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<h1>Guardian News</h1>
5151
<input type="text" id="search-term" /></div></br>
5252
<button id="search-news-button">search news</button>
53-
<button id="refresh-news-button">Refresh news</button></br>
53+
<button id="refresh-news-button">refresh news</button></br>
5454
<div id="main-container"></div>
5555
<script src="bundle.js"></script>
5656
</body>

newsModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class NewsModel {
2828

2929

3030
matchingKeyword = (article) => {
31-
if(article.title.includes(this.keyword)){
31+
if(article.title.toLowerCase().includes(this.keyword.toLowerCase())){
3232
this.relevantArticles.push(article)
3333
}
3434
}

0 commit comments

Comments
 (0)