From 9fd9a9055c31c77abbcd22428b264d4a48660495 Mon Sep 17 00:00:00 2001 From: xzdry Date: Wed, 30 Aug 2023 10:03:30 +0800 Subject: [PATCH] fix: the data passed to shouldRender should be evaled --- .../editor-sdk/src/components/Widgets/CategoryWidget.tsx | 5 ++++- packages/editor-sdk/src/components/Widgets/ObjectField.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/editor-sdk/src/components/Widgets/CategoryWidget.tsx b/packages/editor-sdk/src/components/Widgets/CategoryWidget.tsx index 15fbba1e2..b7c857a6d 100644 --- a/packages/editor-sdk/src/components/Widgets/CategoryWidget.tsx +++ b/packages/editor-sdk/src/components/Widgets/CategoryWidget.tsx @@ -97,7 +97,10 @@ export const CategoryWidget: React.FC> = props = if (typeof propertySpec === 'boolean') { return null; } - return shouldRender(propertySpec.conditions || [], value) ? ( + return shouldRender( + propertySpec.conditions || [], + services.stateManager.deepEval(value) + ) ? ( > = props => { return null; } - return shouldRender(subSpec.conditions || [], value) ? ( + return shouldRender( + subSpec.conditions || [], + services.stateManager.deepEval(value) + ) ? (