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

<SimpleFormIterator>: new item's fields values should default to null instead of empty string #8792

Merged
merged 4 commits into from Apr 3, 2023
Merged

<SimpleFormIterator>: new item's fields values should default to null instead of empty string #8792

merged 4 commits into from Apr 3, 2023

Conversation

kriskw1999
Copy link

This is a copy of this one: #8787

The SimpleFormIterator actually is defaulting every input inside a FormDataConsumer to an empty string. So if I have some arrays, objects, or numbers inside, they default to the empty strings when I add new elements to the array.

I propose to make the default equal to null instead. I know this is a kind of breaking change but I think is more consistent, in case we don't have enough information to determine the right return type null should be better.

This should also solve this issue: #8785 because it will default to null when no default value will be provided.

Let me know what you think about it!

Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

Thanks!

@slax57 slax57 added the RFR Ready For Review label Apr 3, 2023
@slax57 slax57 added this to the 4.10.0 milestone Apr 3, 2023
@slax57 slax57 merged commit 11fbc6e into marmelab:next Apr 3, 2023
7 checks passed
@slax57 slax57 changed the title [SimpleFormIterator] default to null instead of empty string <SimpleFormIterator>: new item's fields values should default to null instead of empty string Apr 3, 2023
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.

None yet

2 participants