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

Change event is not dispatched for particular keypress actions on currency mask. #2757

Open
niklaushug opened this issue Nov 15, 2023 · 0 comments

Comments

@niklaushug
Copy link

niklaushug commented Nov 15, 2023

Bug

Some keyboard interactions on a field with a currency mask does not dispatch a change event. Hence new values are only reflected inside the field but cannot be sended to a backend.

  • If I change the value by pressing keys 0 to 9 a change event gets dispatched.
  • If I change the value by pressing k, m, ArrowUp and ArrowDown NO change event gets dispatched.

At least for keyboard interactions k, m, ArrowUp and ArrowDown a change event should be triggered somewhen.

You can see this behaviour on https://replit.com/@niklaushug/inputmask-does-not-dispatch-change-event-on-certain-keypress

Version 5.0.9-beta.39, 5.0.8 and more are affected by this error. I have no evidence that type of browser or operating system is relevant.

Reason

Proposed fix

Remove inputmask.undoValue = inputmask._valueGet(true); and rely on blurEvent to update undoValue.

See Pull Request 2758

Further thoughts

We may need a change event directly after keyboard interactions k, m, ArrowUp and ArrowDown, to ensure that the new value is saved even if the browser is closed before unfocus the field.

niklaushug added a commit to inventage/Inputmask that referenced this issue Nov 15, 2023
- Instead rely on update of undoValue in blurEvent.
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