Fixed #537 - The 'disabled' option has no effect on InputNumber

pull/548/head
mertsincan 2020-10-09 12:04:44 +03:00
parent 583aaa1b6d
commit b83486be97
1 changed files with 28 additions and 12 deletions

View File

@ -304,18 +304,26 @@ export default {
this.handleOnInput(event, currentValue, newValue); this.handleOnInput(event, currentValue, newValue);
}, },
onUpButtonMouseDown(event) { onUpButtonMouseDown(event) {
this.$refs.input.$el.focus(); if (!this.$attrs.disabled) {
this.repeat(event, null, 1); this.$refs.input.$el.focus();
event.preventDefault(); this.repeat(event, null, 1);
event.preventDefault();
}
}, },
onUpButtonMouseUp() { onUpButtonMouseUp() {
this.clearTimer(); if (!this.$attrs.disabled) {
this.clearTimer();
}
}, },
onUpButtonMouseLeave() { onUpButtonMouseLeave() {
this.clearTimer(); if (!this.$attrs.disabled) {
this.clearTimer();
}
}, },
onUpButtonKeyUp() { onUpButtonKeyUp() {
this.clearTimer(); if (!this.$attrs.disabled) {
this.clearTimer();
}
}, },
onUpButtonKeyDown(event) { onUpButtonKeyDown(event) {
if (event.keyCode === 32 || event.keyCode === 13) { if (event.keyCode === 32 || event.keyCode === 13) {
@ -323,18 +331,26 @@ export default {
} }
}, },
onDownButtonMouseDown(event) { onDownButtonMouseDown(event) {
this.$refs.input.$el.focus(); if (!this.$attrs.disabled) {
this.repeat(event, null, -1); this.$refs.input.$el.focus();
event.preventDefault(); this.repeat(event, null, -1);
event.preventDefault();
}
}, },
onDownButtonMouseUp() { onDownButtonMouseUp() {
this.clearTimer(); if (!this.$attrs.disabled) {
this.clearTimer();
}
}, },
onDownButtonMouseLeave() { onDownButtonMouseLeave() {
this.clearTimer(); if (!this.$attrs.disabled) {
this.clearTimer();
}
}, },
onDownButtonKeyUp() { onDownButtonKeyUp() {
this.clearTimer(); if (!this.$attrs.disabled) {
this.clearTimer();
}
}, },
onDownButtonKeyDown(event) { onDownButtonKeyDown(event) {
if (event.keyCode === 32 || event.keyCode === 13) { if (event.keyCode === 32 || event.keyCode === 13) {