Skip to content

Prefill a required form field of type Number with value 0 results in error #1702

@jnwtr

Description

@jnwtr

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

  1. Add Form node
  2. Add field
  3. Set field to type Number
  4. Check Required property for field
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    size:XSHigh-level sizingtype:bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions