search filter by tag natively
This commit is contained in:
+3
-2
@@ -1144,12 +1144,13 @@ export const matchesFilter = (task: Task) => {
|
|||||||
|
|
||||||
const f = store.filter;
|
const f = store.filter;
|
||||||
|
|
||||||
// Query search (title or content)
|
// Query search (title, content, or currently visible tags)
|
||||||
if (f.query) {
|
if (f.query) {
|
||||||
const q = f.query.toLowerCase();
|
const q = f.query.toLowerCase();
|
||||||
const inTitle = task.title.toLowerCase().includes(q);
|
const inTitle = task.title.toLowerCase().includes(q);
|
||||||
const inContent = task.content?.toLowerCase().includes(q);
|
const inContent = task.content?.toLowerCase().includes(q);
|
||||||
if (!inTitle && !inContent) return false;
|
const inVisibleTags = getVisibleTaskTags(task, ctx).some(tag => tag.toLowerCase().includes(q));
|
||||||
|
if (!inTitle && !inContent && !inVisibleTags) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tags
|
// Tags
|
||||||
|
|||||||
Reference in New Issue
Block a user