Skip to content

Commit e88c538

Browse files
committed
Bug - fixed: entering zero(0) after dot(.) not working
1 parent 1900ea4 commit e88c538

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-numeric-input",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Vue Numeric Input Component",
55
"author": "JayeshLab <helloiamjayesh@gmail.com>",
66
"license": "MIT",

src/vue-numeric-input.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ export default {
169169
* Handle value on Input
170170
*/
171171
inputHandler (val) {
172-
this.updateValue(this.toNumber(val))
172+
this.updateValue(this.toNumber(val), val)
173173
},
174174
/**
175175
* Update value on operation performed
176176
* @param val
177177
*/
178-
updateValue: function (val) {
178+
updateValue: function (val, strVal = null) {
179179
const oldVal = this.numericValue
180180
val = this.toPrecision(val, this.precision)
181181
if (val >= this.max) {
@@ -185,7 +185,7 @@ export default {
185185
val = this.min
186186
}
187187
if (val === oldVal) {
188-
this.$refs.input.value = val
188+
this.$refs.input.value = strVal && val === this.toNumber(strVal) ? strVal : val
189189
return
190190
}
191191
this.numericValue = val

0 commit comments

Comments
 (0)