Skip to content

Fix: Apply a default defalutValue on ArrayInput#10636

Merged
djhi merged 2 commits into
masterfrom
fix/apply_a_default_defalutValue_on_ArrayInput
Apr 4, 2025
Merged

Fix: Apply a default defalutValue on ArrayInput#10636
djhi merged 2 commits into
masterfrom
fix/apply_a_default_defalutValue_on_ArrayInput

Conversation

@erwanMarmelab
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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