surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.01k stars 780 forks source link

Numeric Input Mask - When using a comma as a decimal separator, the focus accidentally jumps before the decimal symbol #8362

Closed JaneSjs closed 3 weeks ago

JaneSjs commented 3 weeks ago

Expected behavior when using a default decimal separator.

https://github.com/surveyjs/survey-library/assets/22372972/12fbaa16-34ac-42d1-a356-4ceab0f51743

The problematic behavior when using the , decimal separator.

https://github.com/surveyjs/survey-library/assets/22372972/10e581a2-10b8-438a-a0cb-dda9add5af02

View Demo

OlgaLarina commented 3 weeks ago

The default thousands separator value is ",". If you set decimalSeparator to “,”, you need to change the “thousandsSeparator” too.

"maskSettings": { "decimalSeparator": ",", "thousandsSeparator": ".", "precision": 1, "max": 100 }

JaneSjs commented 3 weeks ago

@OlgaLarina, thank you. I wish to reset the thouthand separator. I updated mask settings as follows.

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "text",
     "name": "qX",
     "title": "X",
     "maskType": "numeric",
     "maskSettings": {
      "decimalSeparator": ",",
      "thousandsSeparator": " ",
      "precision": 1,
      "max": 100
     }
    }
   ]
  }
 ]
}

https://plnkr.co/edit/C8KahIe49Ydc3h3B