Closed err108 closed 2 years ago
When using the v-facade directive on a component that uses the .number (type cast value as a number) modifier on the v-model directive, the value is being set to an empty string if a 0 is entered.
<v-text-field v-model.number="myNumberThatCanBeZero" v-facade="'##'" />
Looks like a falsy check is being done which is setting the value to the empty string.
https://github.com/RonaldJerez/vue-input-facade/blob/35a95ee21058b16a65533abf99d0a19e820203b6/src/core.js#L156
Would it be be possible update to look for zero there as well? Maybe something like...
currentValue = currentValue || currentValue === 0 ? currentValue : ''
We were using v.1.4.1. This is fixed as of v.2.0.0-beta.3. Closing out the issue.
Note that 2.0 is already released so you shouldn’t have to use the beta anymore.
When using the v-facade directive on a component that uses the .number (type cast value as a number) modifier on the v-model directive, the value is being set to an empty string if a 0 is entered.
<v-text-field v-model.number="myNumberThatCanBeZero" v-facade="'##'" />
Looks like a falsy check is being done which is setting the value to the empty string.
https://github.com/RonaldJerez/vue-input-facade/blob/35a95ee21058b16a65533abf99d0a19e820203b6/src/core.js#L156
Would it be be possible update to look for zero there as well? Maybe something like...
currentValue = currentValue || currentValue === 0 ? currentValue : ''