Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/search case sensitivity #2182

Merged
merged 3 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only suggestion here is that we make sure this doesn't interfere with the tag suggestions which also uses columnIndex={0}. when reading on CellMeasurer I had a hard time truly understanding the role in play here; there's some association with the caches we clear in deriveStateFromProps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per Slack discussion, the -3 index was an attempt to set it out of bounds so it wouldn't conflict with the notes in the list, but doesn't seem to work that way and causes other issues. Since this tests out okay and the height cache glitch isn't new, gonna merge this and we can keep arguing with CellMeasurer another day.

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