From 19f4fe0ed293e5ea3c3af15681a8d053a80813f3 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 17 Feb 2021 18:17:49 +0300 Subject: [PATCH] Fixed #950 - Error when removing InputNumbers from DOM tree --- src/components/inputnumber/InputNumber.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/inputnumber/InputNumber.vue b/src/components/inputnumber/InputNumber.vue index 8a338349b..dc68556e2 100755 --- a/src/components/inputnumber/InputNumber.vue +++ b/src/components/inputnumber/InputNumber.vue @@ -297,14 +297,16 @@ export default { this.spin(event, dir); }, spin(event, dir) { - let step = this.step * dir; - let currentValue = this.parseValue(this.$refs.input.$el.value) || 0; - let newValue = this.validateValue(currentValue + step); - - this.updateInput(newValue, null, 'spin'); - this.updateModel(event, newValue); - - this.handleOnInput(event, currentValue, newValue); + if (this.$refs.input) { + let step = this.step * dir; + let currentValue = this.parseValue(this.$refs.input.$el.value) || 0; + let newValue = this.validateValue(currentValue + step); + + this.updateInput(newValue, null, 'spin'); + this.updateModel(event, newValue); + + this.handleOnInput(event, currentValue, newValue); + } }, onUpButtonMouseDown(event) { if (!this.$attrs.disabled) {