Skip to content

When use dataType=dataTypes.NUMBER, the validation should allow negative number #1256

Closed
@jessieweiyi

Description

@jessieweiyi

Scope: <DESCRIBE SCOPE OF THIS ISSUE, i.e.: PF4 mapper, Form renderer>

Description

When setting dataType=dataTypes.NUMBER and the number users type is negative, the form shows error. I can reproduce on this page: https://data-driven-forms.org/schema/data-types.

Screen Shot 2022-05-18 at 10 25 38 PM

Schema

{
      fields: [
        {
          name: "coordinates.lat",
          label: "Latitude",
          component: componentTypes.TEXT_FIELD,
          type: "number",
          dataType: dataTypes.NUMBER,
          validate: [
            {
              type: validatorTypes.REQUIRED,
            },
          ],
        },
        {
          name: "coordinates.lon",
          label: "Longitude",
          component: componentTypes.TEXT_FIELD,
          type: "number",
          dataType: dataTypes.NUMBER,
          validate: [
            {
              type: validatorTypes.REQUIRED,
            },
          ],
        },
      ],
    };

<If it's possible, please provide a schema which reproduces the issue>

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions