diff --git a/packages/editor/src/hooks/use-filter.ts b/packages/editor/src/hooks/use-filter.ts index b465e068..f3b69814 100644 --- a/packages/editor/src/hooks/use-filter.ts +++ b/packages/editor/src/hooks/use-filter.ts @@ -32,10 +32,12 @@ export const useFilter = ( const visible = filterIsMatch(text, node); if (visible && parents.length) { parents.forEach((parent) => { - updateStatus(nodeStatusMap.value!, parent.id, { - visible, - expand: true, - }); + if (text || text.length) { + updateStatus(nodeStatusMap.value!, parent.id, { + visible, + expand: true, + }); + } }); }