Skip to content

Commit

Permalink
FIX collapsable form
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinovega committed Feb 10, 2022
1 parent 67c043e commit 7beb475
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ const NestedForm = ({ schema, flow, parent, inputWrapper, maybeCustomHttpClient,
entry,
result: option(schemaAndFlow.schema?.collapseField).map(f => f === entry).getOrElse(idx > 0)
})
const isCollapsed = collapsed && option(!step.visibleOnCollapse).getOrElse(idx > 0)

const oneVisibleSetup = Object.values(schema).some(v => !!v.visibleOnCollapse)
const isCollapsed = collapsed && (oneVisibleSetup ? !step.visibleOnCollapse : idx > 0)


return (
Expand Down

0 comments on commit 7beb475

Please sign in to comment.