Case-insensitive search

This commit is contained in:
Chen-I Lim 2020-10-12 08:55:59 -07:00
parent ae93fe22ce
commit 92882fee5f

View file

@ -116,11 +116,11 @@ class BoardTree {
}
private searchFilterCards(cards: IBlock[]) {
const { searchText } = this
const searchText = this.searchText?.toLocaleLowerCase()
if (!searchText) { return cards.slice() }
return cards.filter(card => {
if (card.title?.toLowerCase().indexOf(searchText) !== -1) { return true }
if (card.title?.toLocaleLowerCase().indexOf(searchText) !== -1) { return true }
})
}