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
Do not change/mask initial empty values ("") unless user types the first character
This has been reported originally in another issue (#51), however, it has been 3 years and I guess the old behavior returned.
PS: I believe this may be an usability improvement in some UX scenarios - since the mask will only assist the user to type a value, but never to assume/input an initial value.
Solution
To prevent break change, I suggest to implement a new config parameter or use the existing allowEmpty which is not officially documented in the project.
Start Date
No response
Implementation PR
No response
Reference Issues
No response
Summary
Do not change/mask initial empty values ("") unless user types the first character
This has been reported originally in another issue (#51), however, it has been 3 years and I guess the old behavior returned.
PS: I believe this may be an usability improvement in some UX scenarios - since the mask will only assist the user to type a value, but never to assume/input an initial value.
Solution
To prevent break change, I suggest to implement a new config parameter or use the existing
allowEmpty
which is not officially documented in the project.simple-mask-money/src/set-mask.ts
Line 215 in f2de36e
In my local tests, I found out the solution could be simple like below and all tests passes successfully
References:
Other libraries which allow initial empty values
https://plentz.github.io/jquery-maskmoney/
https://github.com/dm4t2/vue-currency-input
https://github.com/jonathanpmartins/v-money3
Basic Example
Must remain empty
Must be masked
Drawbacks
This improvements depends on a new configuration parameter to prevent creating a break change for existing users which prefers the current behaviour
Unresolved questions
No response
The text was updated successfully, but these errors were encountered: