Skip to content

Commit

Permalink
Merge pull request smartxworks#720 from smartxworks/fix/conditions
Browse files Browse the repository at this point in the history
fix: the data passed to shouldRender should be evaled
  • Loading branch information
tanbowensg authored Aug 30, 2023
2 parents 8e6be11 9fd9a90 commit 32713c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 97,10 @@ export const CategoryWidget: React.FC<WidgetProps<CategoryWidgetType>> = props =
if (typeof propertySpec === 'boolean') {
return null;
}
return shouldRender(propertySpec.conditions || [], value) ? (
return shouldRender(
propertySpec.conditions || [],
services.stateManager.deepEval(value)
) ? (
<SpecWidget
key={name}
component={component}
Expand Down
5 changes: 4 additions & 1 deletion packages/editor-sdk/src/components/Widgets/ObjectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 35,10 @@ export const ObjectField: React.FC<WidgetProps<ObjectFieldType>> = props => {
return null;
}

return shouldRender(subSpec.conditions || [], value) ? (
return shouldRender(
subSpec.conditions || [],
services.stateManager.deepEval(value)
) ? (
<SpecWidget
component={component}
key={name component.id}
Expand Down

0 comments on commit 32713c8

Please sign in to comment.