Skip to content

Commit 827b8f3

Browse files
committed
fix: rjsf hidden logic
1 parent 9732ac4 commit 827b8f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Common/RJSF/templates/ObjectFieldTemplate.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ const Field = ({
5353
if (!hiddenSchemaProp) {
5454
return true
5555
}
56-
const isHidden =
57-
// NOTE: if json is null, then JSONPath will return undefined; hence the ?
58-
hiddenSchemaProp.condition === JSONPath({ path: hiddenSchemaProp.match, json: formData })?.[0]
56+
const value = JSONPath({ path: hiddenSchemaProp.match, json: formData })?.[0]
57+
const isHidden = value === undefined || hiddenSchemaProp.condition === value
5958
// NOTE: if should be hidden then filter it out i.e return false
6059
return !isHidden
6160
})

0 commit comments

Comments
 (0)