VEuPathDB / CoreUI

Core UI for VeuPathDB applications. Provides components, style definitions, and utilities to enable developers to rapidly assemble complex applications with consistent UI and UX across our portfolio of sites.
1 stars 0 forks source link

CheckboxTree: Search term only being applied to leaves when `filteredList` provided #155

Closed dmfalke closed 1 year ago

dmfalke commented 1 year ago

If filteredList and searchTerm are both provided, parent nodes are never "matched". This is due to the following condition:

https://github.com/VEuPathDB/CoreUI/blob/6164b0577807d447b3d6197df5e780d74a478d9b/src/components/inputs/checkboxes/CheckboxTree/CheckboxTree.tsx#L611

I think we need to only consider filteredList if the node is a leaf:

      nodeMatches = searchPredicate(node, searchTerms) && (!isLeaf(node) || filteredSet.has(nodeId));