diff --git a/examples/src/js/FilterExample.jsx b/examples/src/js/FilterExample.jsx index a3e6a671..c4335660 100644 --- a/examples/src/js/FilterExample.jsx +++ b/examples/src/js/FilterExample.jsx @@ -66,7 +66,12 @@ class FilterExample extends Component { // Or a children has a matching node children.length ) { - filtered.push({ ...node, children }); + let addNode = { ...node }; + // check if node is not in expanded list, add it + if (children.length) { + addNode.children = children; + } + filtered.push(addNode); } return filtered;