surveyjs/custom-widgets

Inputmask works incorrectly in react survey widgets

stsiushkevich opened this issue · 2 comments

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

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

See #261

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

See #261

Yes, Thank you!