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 ArrayInput makes the form dirty in strict mode #10421

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Dec 18, 2024

Problem

Fixes #9661

Solution

We had a workaround for adding validation on the ArrayInput itself (like min/max number of items) that triggered a register/unregister of the input in react-hook-form inside a useEffect. This effect is run twice in StrictMode.
It appears the workaround isn't needed anymore to have validation on the ArrayInput.

How To Test

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi added the RFR Ready For Review label Dec 18, 2024
@slax57 slax57 self-requested a review December 19, 2024 10:12
@slax57 slax57 merged commit cd440fd into master Dec 19, 2024
10 checks passed
@slax57 slax57 deleted the fix-array-input-dirty branch December 19, 2024 13:53
@slax57 slax57 added this to the 5.4.4 milestone Dec 19, 2024
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.

SimpleForm isDirty is always true if ArrayInput is used
2 participants