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

react-imask: 'skipInvalid' prop breaks when 'lazy' prop is false and 'unmask' prop is true #1086

Open
YauheniAndryieuski opened this issue Oct 23, 2024 · 0 comments

Comments

@YauheniAndryieuski
Copy link

Describe the bug
When using the react-imask plugin, the skipInvalid feature stops to work when the lazy prop is false and the unmask prop is true.

To Reproduce
Steps to reproduce:

  1. Define an instance of the IMaskInput component;
  2. Add the mask="(000) 000-0000" prop;
  3. Add the value="310 3103101" prop (please note that it contains an invalid character, namely a whitespace);
  4. Add the following props:
    1. lazy={false};
    2. unmask;
    3. skipInvalid.

Link to sandbox: https://codesandbox.io/p/sandbox/crimson-bird-67lgxz

Expected behavior
If the skipInvalid prop is true, then invalid characters should be skipped, even when the lazy prop is false and the unmask prop is true.

Environment:

  • OS: Windows
  • Browser: Chrome
  • Version: 130.0.6723.59
  • IMask version: 7.6.1
  • Framework/plugin version if used: react-imask 7.6.1

Additional context
If I change the lazy prop to true then the skipInvalid feature works fine. Similarly, it works ok if I change the unmask prop to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant