diff --git a/frontend/src/js/concept-trees/ConceptTreeFolder.tsx b/frontend/src/js/concept-trees/ConceptTreeFolder.tsx index 0b3eda0126..6462d09643 100644 --- a/frontend/src/js/concept-trees/ConceptTreeFolder.tsx +++ b/frontend/src/js/concept-trees/ConceptTreeFolder.tsx @@ -8,6 +8,7 @@ import ConceptTree from "./ConceptTree"; import ConceptTreeNodeTextContainer from "./ConceptTreeNodeTextContainer"; import { getConceptById } from "./globalTreeStoreHelper"; import type { SearchT, TreesT } from "./reducer"; +import { isNodeInSearchResult } from "./selectors"; const Root = styled("div")` font-size: ${({ theme }) => theme.font.sm}; @@ -57,6 +58,12 @@ const ConceptTreeFolder: FC = ({ openInitially, }); + if (!search.showMismatches) { + const shouldRender = isNodeInSearchResult(conceptId, search, tree.children); + + if (!shouldRender) return null; + } + const matchingEntries = !tree.children || !tree.matchingEntries ? null