Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(react/note_icon): case insensitive search
Elian Doran4d71b73f3869
diff --git a/apps/client/src/widgets/note_icon.ts.bak b/apps/client/src/widgets/note_icon.ts.bakindex 52ff602475..0fd2b7c1f2 100644--- a/apps/client/src/widgets/note_icon.ts.bak+++ b/apps/client/src/widgets/note_icon.ts.bak@@ -64,7 +64,6 @@ export default class NoteIconWidget extends NoteContextAwareWidget {);}- const search = String(this.$iconSearch.val())?.trim()?.toLowerCase();this.$iconSearch.focus();}diff --git a/apps/client/src/widgets/note_icon.tsx b/apps/client/src/widgets/note_icon.tsxindex 2709003f14..152dd6240b 100644--- a/apps/client/src/widgets/note_icon.tsx+++ b/apps/client/src/widgets/note_icon.tsx@@ -62,14 +62,16 @@ function NoteIconList() {// Filter by text and/or category.let icons: Icon[] = fullIconData.icons;- if (search || categoryId) {+ const processedSearch = search?.trim()?.toLowerCase();+ if (processedSearch || categoryId) {icons = icons.filter((icon) => {if (categoryId !== "0" && String(icon.category_id) !== categoryId) {return false;}- if (search) {- if (!icon.name.includes(search) && !icon.term?.find((t) => t.includes(search))) {+ if (processedSearch) {+ if (!icon.name.includes(processedSearch) &&+ !icon.term?.find((t) => t.includes(processedSearch))) {return false;}}