I have a tree of hierarchical categories, where users can choose which categories they like to filter. We have implemented partially checked cases enter image description here

We have an option for users to search the tree, so we may only see some of the results, specifically the subcategories

enter image description here

The question is: How should the partial category checkbox (Apparel in this example) behave? There are 3 options:

1 - be disabled

2.1 - When users click the partial in becomes fully checked (normal checkbox behavior) - and the 4 leaves will be shown (this ignoring the search filter)

2.2 - When users click the partial in becomes fully checked and only the 1 leaf (Recreational $ Sporting) will be shown complying with filter, but hiding some of the checked items

3 - Only allow users to uncheck the Apparel checkbox - un-expected checkbox behavior but making sure filter shows the effect of the user action.

Thanks, Erez

2 Answers 2


I'm not sure I understand. As far as I understood, the checkboxes don't affect whether the tree search searches these nodes, but rather they affect some other filter (not part of your screenshot). So the tree search itself should be agnostic of the state of the checkboxes, and checking them shouldn't affect the search results within the tree.

If they do affect whether the tree search applies to these nodes, it seems to me that this component has an unusual "circular" logic, leading to the problem you're in - and I would check whether the approach itself is justified.


I'd go for option 2.2 based on the axioms that:

  • checking/unchecking should always work without surprises.
  • The list shows things that either
    1. are explicitly selected by the user, and/or
    2. are matched by the filter, and/or
    3. are parents of items according to 1. and 2.

A tristate item has explicitly selected subitems, which should be shown (§1). The tristate item is shown due to §3.

Once the user checks (or unchecks, doesn't matter) the tristate item, the tristate item itself is explicitly selected (§1), and all its descendants go back to not-explicitly-set state. Thus, they can now be hidden unless matched by the filter.

The functionality could be made even more transparent by highlighting filter-matches e.g. by underlining the matched letters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.