One thing that has been bothering me is that text input fields don't keep nulls as nulls, it makes them empty strings. so imagine the following scenario:
- I keep have a record on database that has 10 fields of type varchar, 8 of them are null
- I fetch the record from database and use to populate form component with all text input fields
- I change only one of the null fields to "foo", and then resubmit
form.data
as whole to update the record in the database - I'm now expecting 3 fields to be populated and 7 to be null as they were. However all those 7 are
= ' '
empty strings now - some backend jobs that used to check on null values are now getting false negatives which can cause additional unexpected behaviour
For my use case, this usually caused backend validation errors. and to mitigate it, I have to do some additional JS like in here to process all fields and remove those empty strings values (others may choose to keep them null).. but this is not so good
Number input fields have a validation rule that keeps null as null. I suggest that text input fields (and maybe all other input types) should also have this feature in case you don't want to keep nulls as nulls by default
Separately and additionally, I suggest you create a property isFormDirty
that tells if form values have changed, that would be nice feature too