formio.js
formio.js copied to clipboard
[BUG] Number Input Value can't be erased
Environment
Please provide as many details as you can:
- Hosting type
- [x] Form.io
- [ ] Local deployment
- Version:
- Formio.js version: 4.13.0
- Frontend framework: React
- Browser: Chrome
- Browser version:
Steps to Reproduce
- Add a Number Input in form (e.g., "numberField1")
- Submit the form with nothing entered, or remove all content of the Number Input
Expected behavior
The data in request payload should include numberField1: null
Observed behavior
The data in request payload does not include numberField1
@zzdjk6 this PR should fix it.
It looks like https://github.com/formio/formio.js/pull/4049 is making empty number fields an empty string rather than null. In 4.14.0-rc.2 I've run into an issue where empty, optional number fields are returning a validation error from the portal because an empty string isn't a number.
FYI PR #4049 is being reverted. Empty number fields should be null, not an empty string.
Is that issue fixed? In which version I will get this fix?
This issue is still persist :(
Any news in this? Using version 4.17.1 and the issue still persists, any workarround?
Thank you for reporting this issue. I am able to reproduce it and have logged a ticket for the backlog. We are always willing to review any contributions to resolve this issue from the open-source community.
For internal reference: FIO-8148