mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 17:49:02 +01:00
chore(react/note_icon): case insensitive search
This commit is contained in:
parent
b20ffdf7db
commit
4d71b73f38
@ -64,7 +64,6 @@ export default class NoteIconWidget extends NoteContextAwareWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = String(this.$iconSearch.val())?.trim()?.toLowerCase();
|
|
||||||
|
|
||||||
this.$iconSearch.focus();
|
this.$iconSearch.focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,14 +62,16 @@ function NoteIconList() {
|
|||||||
|
|
||||||
// Filter by text and/or category.
|
// Filter by text and/or category.
|
||||||
let icons: Icon[] = fullIconData.icons;
|
let icons: Icon[] = fullIconData.icons;
|
||||||
if (search || categoryId) {
|
const processedSearch = search?.trim()?.toLowerCase();
|
||||||
|
if (processedSearch || categoryId) {
|
||||||
icons = icons.filter((icon) => {
|
icons = icons.filter((icon) => {
|
||||||
if (categoryId !== "0" && String(icon.category_id) !== categoryId) {
|
if (categoryId !== "0" && String(icon.category_id) !== categoryId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (search) {
|
if (processedSearch) {
|
||||||
if (!icon.name.includes(search) && !icon.term?.find((t) => t.includes(search))) {
|
if (!icon.name.includes(processedSearch) &&
|
||||||
|
!icon.term?.find((t) => t.includes(processedSearch))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user