From 89d8b14ada83c59d7de207119756194a930fac4a Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 14 Oct 2020 15:25:19 +0300 Subject: [PATCH] Fixed #562 - The 'disabled' option has no effect on InputNumber --- src/components/inputnumber/InputNumber.vue | 40 +++++++++++++++------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/components/inputnumber/InputNumber.vue b/src/components/inputnumber/InputNumber.vue index 99482eb5d0..860ab6dabc 100755 --- a/src/components/inputnumber/InputNumber.vue +++ b/src/components/inputnumber/InputNumber.vue @@ -270,18 +270,26 @@ export default { this.updateModel(event, newValue); }, onUpButtonMouseDown(event) { - this.$refs.input.$el.focus(); - this.repeat(event, null, 1); - event.preventDefault(); + if (!this.$attrs.disabled) { + this.$refs.input.$el.focus(); + this.repeat(event, null, 1); + event.preventDefault(); + } }, onUpButtonMouseUp() { - this.clearTimer(); + if (!this.$attrs.disabled) { + this.clearTimer(); + } }, onUpButtonMouseLeave() { - this.clearTimer(); + if (!this.$attrs.disabled) { + this.clearTimer(); + } }, onUpButtonKeyUp() { - this.clearTimer(); + if (!this.$attrs.disabled) { + this.clearTimer(); + } }, onUpButtonKeyDown(event) { if (event.keyCode === 32 || event.keyCode === 13) { @@ -289,18 +297,26 @@ export default { } }, onDownButtonMouseDown(event) { - this.$refs.input.$el.focus(); - this.repeat(event, null, -1); - event.preventDefault(); + if (!this.$attrs.disabled) { + this.$refs.input.$el.focus(); + this.repeat(event, null, -1); + event.preventDefault(); + } }, onDownButtonMouseUp() { - this.clearTimer(); + if (!this.$attrs.disabled) { + this.clearTimer(); + } }, onDownButtonMouseLeave() { - this.clearTimer(); + if (!this.$attrs.disabled) { + this.clearTimer(); + } }, onDownButtonKeyUp() { - this.clearTimer(); + if (!this.$attrs.disabled) { + this.clearTimer(); + } }, onDownButtonKeyDown(event) { if (event.keyCode === 32 || event.keyCode === 13) {