Question T19396
Visible to All Users

nouislider's handle not placed in correct position

created a year ago

I have initiated a new Next.js project and I am using the demo code from:
https://surveyjs.io/form-library/examples/custom-widget-nouislider/reactjs#content-code

But the handle is not placed in the correct position as shown in the photo. The following code is similar to the demo but with the changed nouislider.css directory at nouislider/dist.

JavaScript
"use client"; import React from "react"; import { Model } from "survey-core"; import { Survey } from "survey-react-ui"; import "survey-core/defaultV2.min.css"; import * as SurveyCore from "survey-core"; import noUiSlider from "nouislider"; import { nouislider } from "surveyjs-widgets"; import "nouislider/dist/nouislider.css"; const json = { elements: [ { type: "nouislider", name: "range", title: "Please range", }, ], }; nouislider(SurveyCore); function SurveyComponent() { const survey = new Model(json); survey.onComplete.add((sender, options) => { console.log(JSON.stringify(sender.data, null, 3)); }); return <Survey model={survey} />; } export default SurveyComponent;
Comments (3)

    Hello,
    Perhaps, the issue with a slider handle relates to some CSS / customizations. For me to move forward and research this issue, I need to reproduce it on my end. Please feel free to update this CodeSandbox demo or send a minified version of your project to help me reproduce the issue and research it.

    Thank you

      Hi, I found that the issue is caused by the nouislider version. Once I switched from 15.8.1 to 14.6.0 in package.json, everything worked fine.

      JSON
      "nouislider": "^15.8.1",

      to

      JSON
      "nouislider": "14.6.0",

        Hi,
        Thank you for sharing your results. I'm happy to hear that you found the cause of the issue.

        Let us know if you have more questions.

        Answers approved by surveyjs Support

        created 3 months ago

        Hello,
        Please be informed that v2.0.0 introduces a new question type: New Slider and Range Slider Question Types. Please feel free to test our Slider question. Let us know if you have any further questions or feedback.

        Thank you