Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The inputmask is autocompleted to the min value when deleting the radix point #2773

Open
ersib opened this issue Feb 15, 2024 · 1 comment
Open
Assignees
Labels
Milestone

Comments

@ersib
Copy link

ersib commented Feb 15, 2024

  • Bug description:
    I am using the options below for an inputmask instance. My input accepts a decimal value within a given range.
    { "alias": "decimal", "min": 35, "max": 200, "digits": 2, "rightAlign": false, "allowMinus": false, "showMaskOnHover": false, "showMaskOnFocus": false, "jitMasking": true, "shortcuts": null }
    In the image below I describe some situations where if I delete the radix point, a reevaluation is performed which sets the value to the predefined minimum value. I would like the value to remain unchanged and to allow the user to continue typing.

inputmaskRadixPoint

When debugging the inputmask plugin code, I found that the method which is responsible for this reevalution is onKeyDown() and particularly the highlighted line in dist/inputmask.js.

image

  • OS: Windows 10
  • Browser: Chrome Version 121.0.6167.161 (Official Build) (64-bit)
  • Inputmask version: 5.0.8

Thank you very much!

@Techn1c4l
Copy link

The only workaround I've managed to find is using the digitsOptional: false. Actually, this is an important issue. I think the noValuePatching option should allow us not to patch the value while we're typing.

@RobinHerbots RobinHerbots self-assigned this Apr 2, 2024
@RobinHerbots RobinHerbots pinned this issue Apr 2, 2024
@RobinHerbots RobinHerbots added this to the 5.0.9 milestone Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants