node-red-dashboard
node-red-dashboard copied to clipboard
Prefill a required form field of type Number with value 0 results in error
Current Behavior
When setting the default value for a Required Field in a Form node to 0 (zero), the dashboard shows an error message below this field "<Prop. name> is required" and the color of the field is set to red. However, the value 0 is shown in the field, so it is not empty
Expected Behavior
Field should not be set to error state. Probably checked with not operator (!) instead of using 'null' test
Steps To Reproduce
- Add Form node
- Add field
- Set field to type Number
- Check Required property for field
- Send input message to Form node with payload.<field_name> set to 0 (zero), as documented here
Environment
- Dashboard version: 1.23.0
- Node-RED version: 4.0.1
- Node.js version: v20.9.0
- npm version: 9.6.7
- Platform/OS: Windows 11
- Browser: Chrome 136.0.7103.93 (Official Build) (64-bit)
Have you provided an initial effort estimate for this issue?
I am not a FlowFuse team member