You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
niklaushug
added a commit
to inventage/Inputmask
that referenced
this issue
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.
0
to9
a change event gets dispatched.k
,m
,ArrowUp
andArrowDown
NO change event gets dispatched.At least for keyboard interactions
k
,m
,ArrowUp
andArrowDown
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
applyInputValue
is executed beforeblurEvent
applyInputValue
does set undoValue to the new valueblurEvent
does only dispatch a change event if undoValue is not equal to new valueProposed fix
Remove
inputmask.undoValue = inputmask._valueGet(true);
and rely onblurEvent
to update undoValue.See Pull Request 2758
Further thoughts
We may need a change event directly after keyboard interactions
k
,m
,ArrowUp
andArrowDown
, to ensure that the new value is saved even if the browser is closed before unfocus the field.The text was updated successfully, but these errors were encountered: