From c984c1a0cf0c934d41e5affb471d2ff2efa4bb97 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 2 Jul 2025 19:47:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E6=A0=91=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=90=8E=E4=B8=8D=E5=B1=95=E5=BC=80=E6=89=80?= =?UTF-8?q?=E6=9C=89=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/hooks/use-filter.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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, + }); + } }); }