-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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>
adds previously removed item
#8029
Fix <ArrayInput>
adds previously removed item
#8029
Conversation
label="CustomLabel" | ||
defaultValue="[email protected]" | ||
/> | ||
</SimpleFormIterator> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you also include an input with no default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
); | ||
|
||
// add field and call the onClick event of the button passed as addButton prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it was unnecessary and actually induced an issue by adding an item twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'll break in the case where the developer passed a custom add button. If there is a double add, you should probably remove the one in AddItemButton instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restored
); | ||
|
||
// add field and call the onClick event of the button passed as addButton prop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'll break in the case where the developer passed a custom add button. If there is a double add, you should probably remove the one in AddItemButton instead.
<ArrayInput>
adds previously removed item
Fixes #7385