Skip to content

fix(utils): default value for defaults as objects #4637

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

Merged
merged 4 commits into from
May 30, 2025

Conversation

foyarash
Copy link
Contributor

Reasons for making this change

fixes #4635

This PR fixes a situation where having a default set as an object, typically used for selects or radio buttons, would make the associated field frozen, with its value being impossible to change in the form.

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@heath-freenome
Copy link
Member

@foyarash Thanks for the fix AND it seems you and another person are making changes to the exact same code. Can you look at the other person's fix and see if how your changes may affect their PR?

@foyarash
Copy link
Contributor Author

@heath-freenome hello, so I tested the PR with my changes. It seems to work but requires to add some extra condition on my side, so I guess I'll wait for the PR to be merged first

@Lonli-Lokli
Copy link

@foyarash I think @heath-freenome wants to merge yours first, actually :)
Can you try to add a few tests with array defaults, so I will be sure that my rebased PR will not break your code?

@foyarash
Copy link
Contributor Author

@foyarash I think @heath-freenome wants to merge yours first, actually :) Can you try to add a few tests with array defaults, so I will be sure that my rebased PR will not break your code?

Actually i think it should be fine for the arrays, my PR doesnt have any impact on form datas that are arrays.

@heath-freenome heath-freenome merged commit 5071361 into rjsf-team:main May 30, 2025
4 checks passed
x0k added a commit to x0k/svelte-jsonschema-form that referenced this pull request May 30, 2025
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.

Can't use default object with enum object (Radio list)
4 participants