From d6eacd8cf6a1821af0ccc778c5e89f305315300c Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Wed, 17 May 2023 09:21:14 -0400 Subject: [PATCH] In search-mode, select only search-matched descendants Context: "Filter lists" pane. --- src/js/3p-filters.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/3p-filters.js b/src/js/3p-filters.js index b6a2c9945..4e02768f9 100644 --- a/src/js/3p-filters.js +++ b/src/js/3p-filters.js @@ -378,8 +378,11 @@ const toggleFilterList = (elem, on, ui = false) => { input.checked = on; dom.cl.toggle(listEntry, 'checked', on); dom.cl.toggle(listEntry, 'stickied', ui && !on); - // Select/unselect descendants - const childListEntries = qsa$(listEntry, '.listEntry'); + // Select/unselect descendants. Twist: if in search-mode, select only + // search-matched descendants. + const childListEntries = dom.cl.has('#lists', 'searchMode') + ? qsa$(listEntry, '.listEntry.searchMatch') + : qsa$(listEntry, '.listEntry'); for ( const descendantList of childListEntries ) { dom.cl.toggle(descendantList, 'checked', on); qs$(descendantList, ':scope > .detailbar input').checked = on;