Fixing edge case for command and select with data-keywords filtering, updating macros for command and sidebar

This commit is contained in:
Ronan Berder
2025-12-10 14:49:32 +08:00
parent 77680f9e2b
commit c0bf373890
9 changed files with 152 additions and 50 deletions
+6 -2
View File
@@ -55,8 +55,12 @@
}
const itemText = (item.dataset.filter || item.textContent).trim().toLowerCase();
const keywords = (item.dataset.keywords || '').toLowerCase();
const matches = itemText.includes(searchTerm) || keywords.includes(searchTerm);
const keywordList = (item.dataset.keywords || '')
.toLowerCase()
.split(/[\s,]+/)
.filter(Boolean);
const matchesKeyword = keywordList.some(keyword => keyword.includes(searchTerm));
const matches = itemText.includes(searchTerm) || matchesKeyword;
item.setAttribute('aria-hidden', String(!matches));
if (matches && menuItems.includes(item)) {
visibleMenuItems.push(item);