Select field value is empty string in stead of null
Describe the bug
The Select component uses "" as the value when no option is selected. I would have expected null, which integrates a lot better with other tools (camunda in my particular case). It makes a difference, because null would mean no value is set, which is correct, whereas an empty string is seen as a value.
Version/Branch v5.0.1
To Reproduce Steps to reproduce the behavior:
- Create a new form
- Add a select component
- Configure a couple of values to choose from
- Select a value
- Click the cross to empty the value
Expected behavior
The value will be equal to null to indicate that no value was selected
Actual behavior
The field's value is equal to "" (empty string)
This is expected behavior. https://es5.github.io/#x9.2
The resulting json with "" as a value in stead of null is not necessarily processed in javascript (ES5) as you suggest, but in this case in Java. If it was expected behaviour I would expect to find this in the documentation. Please reopen the ticket.
This may have been fixed with my pull request @ https://github.com/formio/formio.js/pull/6054 and in particular the change made here https://github.com/formio/formio.js/pull/6054/files#diff-05d41a5d854049f92f62772ee82f295d614534d5f4f0717b3ec30c69dfc3a7f5R2905. Before it would set the default value to empty string instead of the components "emptyValue". Please let us know if this is indeed resolved for you.