surveyjs / custom-widgets

The collection of custom widgets for SurveyJS: Survey Library and Survey Creator :package:
https://surveyjs.io
MIT License
79 stars 78 forks source link

Inputmask works incorrectly in react survey widgets #261

Closed stsiushkevich closed 3 years ago

stsiushkevich commented 3 years ago

When I input 1.2345 then I get 123.45 after clearing a focus.

There is an example:

https://codesandbox.io/s/jovial-andras-768jm?file=/src/SurveyComponent.jsx

tsv2013 commented 3 years ago

I'll take a look

tsv2013 commented 3 years ago

I think you need to use the autoUnmask: false,:

        {
          type: "text",
          inputMask: "9[9][9][.9{*}]",
          autoUnmask: false,
          title: "Decimal:"
        }

Here is your updated code sandbox sample - https://codesandbox.io/s/fervent-nash-hvb5j?file=/src/SurveyComponent.jsx:510-650