From e02f55ef5bf69459989035e41b3f7691dc02b522 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 25 Nov 2020 15:44:10 +0300 Subject: [PATCH] Fixed #633 - InputNumber's onInputBlur fails when component gets destroyed --- src/components/inputnumber/InputNumber.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/inputnumber/InputNumber.vue b/src/components/inputnumber/InputNumber.vue index 82370fdb6..31fa67b0c 100755 --- a/src/components/inputnumber/InputNumber.vue +++ b/src/components/inputnumber/InputNumber.vue @@ -798,10 +798,12 @@ export default { onInputBlur() { this.focused = false; - let newValue = this.validateValue(this.parseValue(this.$refs.input.$el.value)); - this.$refs.input.$el.value = this.formatValue(newValue); - this.$refs.input.$el.setAttribute('aria-valuenow', newValue); - this.updateModel(event, newValue); + if (this.$refs && this.$refs.input) { + let newValue = this.validateValue(this.parseValue(this.$refs.input.$el.value)); + this.$refs.input.$el.value = this.formatValue(newValue); + this.$refs.input.$el.setAttribute('aria-valuenow', newValue); + this.updateModel(event, newValue); + } }, clearTimer() { if (this.timer) {