Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fieldset): Fix handleValidation for undefined fieldset #144

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

denatys
Copy link
Contributor

@denatys denatys commented Mar 7, 2025

handleValidation({}) for fieldsets is not working. But working fine for createHeadless form

@denatys denatys force-pushed the fix-validation-for-fieldsets branch 2 times, most recently from cd12d91 to 4eb3067 Compare March 7, 2025 11:45
@denatys denatys force-pushed the fix-validation-for-fieldsets branch from 4eb3067 to ebdd77c Compare March 7, 2025 11:53
@denatys denatys changed the title Fix handleValidation for undefined fieldsets fix(conditionals): Fix handleValidation for undefined fieldsets Mar 7, 2025
@denatys denatys changed the title fix(conditionals): Fix handleValidation for undefined fieldsets fix(fieldset): Fix handleValidation for undefined fieldset Mar 7, 2025
denatys added 6 commits March 7, 2025 13:44
Ensure `getField` handles undefined `formFields` by providing a fallback to an empty array. Also, properly check if `currentField` exists before accessing its `inputType` property to prevent errors. This improves robustness when processing form field values.
Simplify and streamline the logic for determining field values and types when validating `if` conditions. Removes redundant variable declarations and improves readability without altering functionality.
Refactored the value assignment logic to use the nullish coalescing operator for improved readability and consistency. This change ensures clearer handling of formValues and default values for FIELDSET types. No functional behavior is altered.
@denatys
Copy link
Contributor Author

denatys commented Mar 10, 2025

@sandrina-p hi, can you review PR, my users waiting for this ;)

@dragidavid
Copy link
Collaborator

dragidavid commented Mar 10, 2025

Hi @denatys! We are building the next major version of JSF, which includes/will include your bugfix. For that reason we won't review your PR, so we can focus on shipping the next version as soon as possible.

In the meantime, here's a dev release based on this PR to unblock you. We hope that's okay for now.

npm i @remoteoss/json-schema-form@0.11.12-dev.20250310202108

Thank you!

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