-
Notifications
You must be signed in to change notification settings - Fork 17
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
Persistent value after clearing values #11
Comments
@rgb-one you could submit a pull request with the fix we came up with. |
Cool :); gonna go over the code some more so I can understand it better. Thanks @alevans4 |
sorry for bumping this issues, is this problem already solved? because I still can't clear values on input programmaticaly. |
Haven't submitted a pull request. watch: {
// ...
value(val) {
this.cleave.setRawValue(val)
}
} |
@rgb-one your solution works, how about send a PR for this? Thanks. |
@rgb-one : your solution works, but i'm using non-standar format for thousand separator. So I change it a bit: watch: {
// ...
value(val) {
this.cleave.setRawValue(val.replace(/\D/g,''))
}
} Basically I remove all char and only keep number on string. Is this way correct too? |
That seems like it would work, but I think adding such functionality would be better done using "Custom Options" provided by the Cleave package: Here's an example: https://jsfiddle.net/rgb1/LfLbvgrL/4/. |
I have it working with:
|
When clearing the values of inputs, the cleave components retain the initial value in a variable called
initValue
.This shows the value retained by the component on the left where the normal input dialog on the right, after being cleared is empty:
The text was updated successfully, but these errors were encountered: