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
{{ message }}
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
Enter the numbers in the input box, for example, '123A'.
Select 3 with the mouse selection and enter e.g. 'A', you should get '12AA'.
Then delete the first letter A;
Determine the error, now the entered value '12A' does not match the mask;
What is Expected?
The value entered, instead of 3, was expected not to be displayed when entered.
What is actually happening?
The entered value is not masked in any way.
Why can this happen ?
The v-mask sources have an updateValue() method in which we get the entered value and check it to change it later. There are 3 conditions in the check: isValueChanged, isLengthIncreased and isUpdateNeeded, which is a resultant check of the previous conditions.
The whole problem is the condition isLengthIncreased, when we enter a value, it checks that if the length of the current value is greater than the length of the previous value, then the condition is true, otherwise it is false. And if the value is false, then the condition isUpdateNeeded, which checks all conditions for true, also fails and is false, and the value does not change in any way.
This problem is solved by removing the condition isLengthIncreased !
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Versions of V-Mask and Vue
2.2.4, 2.6.11
Reproduction Link
https://codesandbox.io/embed/v-mask-bug-fnm7m3?fontsize=14&hidenavigation=1&theme=dark
Steps to reproduce
What is Expected?
The value entered, instead of 3, was expected not to be displayed when entered.
What is actually happening?
The entered value is not masked in any way.
Why can this happen ?
The v-mask sources have an updateValue() method in which we get the entered value and check it to change it later. There are 3 conditions in the check: isValueChanged, isLengthIncreased and isUpdateNeeded, which is a resultant check of the previous conditions.
The whole problem is the condition isLengthIncreased, when we enter a value, it checks that if the length of the current value is greater than the length of the previous value, then the condition is true, otherwise it is false. And if the value is false, then the condition isUpdateNeeded, which checks all conditions for true, also fails and is false, and the value does not change in any way.
This problem is solved by removing the condition isLengthIncreased !
The text was updated successfully, but these errors were encountered: