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

Initial values #4

Open
drazik opened this issue Apr 18, 2023 · 0 comments
Open

Initial values #4

drazik opened this issue Apr 18, 2023 · 0 comments

Comments

@drazik
Copy link
Contributor

drazik commented Apr 18, 2023

For now the initial values are given in the model prop. But the schema can contain initial values too. So we have a helper function like getInitialValue (not included in the lib as it's pretty specific to the entities from Symfony that we have to deal with in our projects) that takes the form and an object and tries to get the initial value or each field for that.

It means that the user have to merge initial values from the schema and from an entity. I think it would be better for the user to only give the data related to the entity, and let the Form component get initial value from the schema if it should be used (e.g. if the given model doesn't have a value for a given field, but the schema has one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant