Skip to content

Conversation

danielcardoso5
Copy link
Collaborator

@danielcardoso5 danielcardoso5 commented Apr 11, 2025

This PR brings support for conditionals that affect nested fieldset fields. It ensures their conditional display (reported by isVisible) and validation logic works correctly.

This focuses on v0 version of json-schema-form. Some issues were also identified with v1, they'll be fixed on an upcoming PR.

Here are examples of the differences between current functionality and the one introduced, using the schemaWithNestedFieldsetsConditionals schema used in the tests. Note that the Retirement plan is conditionally required based on the Has retirement plan? selection, and so, should not appear by default.

Screenshots

before after
default render image image
submit without filling image image
invalid submission before, now valid image image
resolving nested conditional visibility image image

As visible in the screenshots, the default visibility of the nested fieldset didn't take into account the existing conditional logic.

chore: includes changes to fix the build script for v0 and lint-staged script

@danielcardoso5 danielcardoso5 force-pushed the fix-nested-fieldset-conditional branch from d36362a to 83afe41 Compare April 11, 2025 17:20
@remotecom remotecom force-pushed the fix-nested-fieldset-conditional branch from 83afe41 to 26b4682 Compare April 11, 2025 17:22
ollyd
ollyd previously approved these changes Apr 15, 2025
Copy link
Collaborator

@ollyd ollyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally and it's working well. Nice one!

@danielcardoso5 danielcardoso5 force-pushed the fix-nested-fieldset-conditional branch 2 times, most recently from 83813f2 to de844d0 Compare June 3, 2025 16:49
@danielcardoso5 danielcardoso5 force-pushed the fix-nested-fieldset-conditional branch from de844d0 to 6535096 Compare September 26, 2025 11:37
@danielcardoso5
Copy link
Collaborator Author

Internal pipeline 🟢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants