Merge pull request #3274 from SillyTavern/search-term-empty-folders Search term search will show empty folders too

5b37d22e2df8709b1c0978a22ebe0960514e96e8

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +3 -2Showing whitespace changes
public/scripts/tags.js+3 -2
@@ -196,9 +196,10 @@ function filterByTagState(entities, { globalDisplayFilters = false, subForEntity
196 return false;196 return false;
197 }197 }
198198
199 // Hide folders that have 0 visible sub entities after the first filtering round199 // Hide folders that have 0 visible sub entities after the first filtering round, unless we are inside a search via search term.
200 // Then we want to display folders that mach too, even if the chars inside don't match the search.
200 if (entity.type === 'tag') {201 if (entity.type === 'tag') {
201 return entity.entities.length > 0;202 return entity.entities.length > 0 || entitiesFilter.getFilterData(FILTER_TYPES.SEARCH);
202 }203 }
203204
204 return true;205 return true;