Skip to content

Dragging the thumb of the second slider is not smooth when a survey includes two sliders #10559

@jodeleeuw

Description

@jodeleeuw

Describe the bug

If there are two slider elements on a page with a step set, the first slider does not obey the step size while it is being dragged. The second one does.

Steps to reproduce

Open this reproducible example.

<!DOCTYPE html>
<html>
  <head>
    <link href="https://unpkg.com/[email protected]/survey-core.css" rel="stylesheet" />
    <script src="https://unpkg.com/[email protected]/survey.core.min.js"></script>
    <script src="https://unpkg.com/[email protected]/survey-js-ui.min.js"></script>
  </head>
  <body>
    <div id="surveyContainer"></div>
    <script>
      const survey = new Survey.Model({
        elements: [
          {
            type: "slider",
            name: "slider1",
            min: -2,
            max: 2,
            step: 1,
            labelCount: 5
          },
          {
            type: "slider",
            name: "slider2",
            min: -2,
            max: 2,
            step: 1,
            labelCount: 5
          }
        ]
      });
      survey.render(document.getElementById("surveyContainer"));
    </script>
  </body>
</html>

Drag the first slider. It smoothly goes between options, despite step: 1. The second slider correctly snaps during drag.

Expected behavior
The first slider should snap during drag to the values that are multiples of step.

Please complete the following information:

  • Browser: Chrome
  • Browser version: 141
  • JS framework/library: Vanilla JS
  • SurveyJS version: v2.3.12
  • Device: PC

Metadata

Metadata

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