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: Apply a default defalutValue on ArrayInput #10636

Merged
merged 2 commits into from
Apr 4, 2025

Conversation

erwanMarmelab
Copy link
Contributor

@erwanMarmelab erwanMarmelab commented Apr 2, 2025

Problem

Instead of all other inputs, ArrayInput doesn't provide a default defalutValue.
This is an issue when calling the react-hook-form reset method as react-hook-form will not reset fields that don't have default values.

Solution

Apply a default defalutValue on ArrayInput

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

A test that call reset on an ArrayField inside a Create would be great

@djhi djhi added this to the 5.7.1 milestone Apr 4, 2025
@djhi djhi merged commit 43bc724 into master Apr 4, 2025
16 checks passed
@djhi djhi deleted the fix/apply_a_default_defalutValue_on_ArrayInput branch April 4, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants