Skip to content

Numeric Single-Line Input: Validation error occurs for certain floating-point values when step is non-integer #10927

@orilux

Description

@orilux

Describe the bug
Incorrect validation errors appear on specific values when a text input is set to type numeric with a non-integer step.

Steps to reproduce

  1. Add a single line text question
  2. Set its type to "numeric"
  3. Set its step to 0.01
  4. Preview the form and enter a value between 1.09 and 1.16
  5. Try to complete the form

Sandbox

https://codesandbox.io/p/devbox/wizardly-bartik-mfflw4?workspaceId=ws_XLh56vHr7DzqQTbqk9eWcs

Example JSON

{
  pages: [
    {
      name: "page1",
      elements: [
        {
          type: "text",
          name: "question2",
          description:
            "Enter a value between 1.09 and 1.16 and try to complete the form",
          isRequired: true,
          inputType: "number",
          step: 0.01,
        },
      ],
    },
  ],
  headerView: "advanced",
  checkErrorsMode: "onValueChanged",
}

Please complete the following information:

  • Browser: chrome
  • Browser version: 144.0.7559.133
  • JS framework/library: any
  • SurveyJS version: latest

Metadata

Metadata

Assignees

Labels

buguser issueAn issue or bug reported by users

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions