Skip to content

Issue when resetting certain numbers with a default value #4202

@ayush-shta

Description

@ayush-shta

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Numbers not resetting when the number entered in that field ends with the default value provided for that field in the schema

Expected Behavior

Values should reset as expected and should not depend upon what the default value is

Steps To Reproduce

I tried to replicate this issue in the playground. Link

  1. Lets say I have a schema including one of the property to be like the one below. Here the default value of this field is 1.
  "number": {
      "title": "Number",
      "type": "number",
      "default": 1
    },
  1. Now I type in the value for this filed as any number ending with the default value (for example, 11, 231, 0.1, 1.1, 2.1, 0.0001)
  2. After that, lets click the button to reset the form
  3. The value for that field does not reset
  4. However if we type in any other number that does not end with the default value it will reset as expected

Environment

- OS:
- Node:
- npm:

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions