Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

minimum, maximum and multipleOf not working as expected #138

@marianobianchi

Description

@marianobianchi

When using the playground in https://rjsf-team.github.io/react-jsonschema-form/ I can make use of minimum, maximum and multipleOf and they are working correctly. To reproduce, go to "numbers" example (click on button Numbers at the top of the page) and add to the "number" field in the JSON schema these properties:

"minimum": 0,
"maximum": 100,
"multipleOf": 0.5

You can see it in action in the next gif

example_number_working

Here I show how the step is working (going up and down 0.5 in each click) and the minimum limit is working too (I kept clicking down but the number remained in 0).

When I test this in rjsf-material-ui playground, this is not working at all. I don't get the limit nor the step working as expected. I didn't have the time to check the code to see what can be wrong, but I wanted to add the issue at least to let this open until someone can fix it.

To reproduce this issue, you should add this in the JSON schema for the "number" field:

"minimum": 0,
"maximum": 100,
"multipleOf": 0.5

and this in the uiSchema:

"number": {
  "ui:widget": "updown"
}

With these changes, it is working like this:

example_number_not_working

But it seems that the "multipleOf" is being used to validate, because if I write a number that is not a multiple of 0.5, I get this:

imagen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions