Skip to content

Commit

Permalink
Fix/search case sensitivity (#2182)
Browse files Browse the repository at this point in the history
* search should be case insensitive

* fix missing search results due to column alignment

* lowercase term instead of regex
  • Loading branch information
codebykat authored Jul 6, 2020
1 parent 4e90379 commit 7d42493
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/note-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const renderNote = (
) : (
<CellMeasurer
cache={heightCache}
columnIndex={-3}
columnIndex={0}
key="notes-header"
parent={parent}
rowIndex={index}
Expand Down
4 changes: 3 additions & 1 deletion lib/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ export const middleware: S.Middleware = (store) => {

if (
searchTerms.length > 0 &&
!searchTerms.every((term) => note.content.includes(term))
!searchTerms.every((term) =>
note.content.includes(term.toLocaleLowerCase())
)
) {
continue;
}
Expand Down

0 comments on commit 7d42493

Please sign in to comment.