Skip to content

How prevent iMask deleting last character in case of incorrect Date? #976

@fedorinoGore

Description

@fedorinoGore

Describe the bug
Im using REact component and when entering non existing date the IMaskInput just deletes the last character in Year value

To Reproduce
here is an example

  1. Try to enter 29/02/2022 and you will not be able to enter 2022 year, or 2021. Only 2020 will work because this date is valid
  2. Try to change 29/02/2020 to 30/02/2020 - you can't do that also.

https://codesandbox.io/s/compassionate-shtern-d5kcmk?file=/src/DateInput.tsx

Expected behavior
Just let me turn off this behaviour.
I want to correct the date or raise an error by myself on my initiative after all data is entered. No correction or validation of the Date required from the iMask package except that created by my own.

Environment:

  • OS: OS X
  • Browser: Chrome
  • Version: 119
  • IMask version: react-imask 7.2.0
  • Framework/plugin version if used: React

Additional context
It is a pity that library is so badly documented...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions