-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Bug - Vue Model not updating #252
Comments
@g0ld3neag1e also seeing this. Is the above a fix you can PR? |
@chasegiunta My fix works as expected if using Directives only, but it creates a glitch if also using the Component side. I found that when using a number mask and deleting the value from the input this creates a loop that produces a max stack error. I mainly was putting this on the radar, as I don't have time to track that issue down. So, for now, I wouldn't want to add it to the main branch. |
@g0ld3neag1e Cool. I ended up ditching v-model helper for this case, listening input, and doing this as a workaround, with imask's
|
@g0ld3neag1e Can you describe where/how you called this method? I am using the directive and struggeling to get this wokring. |
Hello guys, can you provide some fiddle to run? |
Refer to "How to Use: 1" |
@sem4phor I downloaded a copy of the iMask JS and updated the function I have listed above at line, roughly, 3465. Hope that helps. P.S. This is not ideal fix as it causes an error on the component side, and it detaches your project from the cdn and future updates. |
Here's a codesandbox showing the issue |
@sem4phor |
Because Vue Model is not triggered with external value changes i.e.
element.value = "",
the bound value on Vue is no updated after a mask is complete and if values are entered still.I found this when using a phone mask "(999) 999-9999". The mask would work fine, but if I hit an extra key after the last character the Vue data would be "(999) 999-9999X".
To solve this, I added updated
InputMask.updateControl
to :The text was updated successfully, but these errors were encountered: