From b83486be97b9cf2ec38b0b252ada70d9c886a52d Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 9 Oct 2020 12:04:44 +0300 Subject: [PATCH] Fixed #537 - 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 b80ec036a..815c295ed 100755 --- a/src/components/inputnumber/InputNumber.vue +++ b/src/components/inputnumber/InputNumber.vue @@ -304,18 +304,26 @@ export default { this.handleOnInput(event, currentValue, 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) { @@ -323,18 +331,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) {