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) {
if (!this.$attrs.disabled) {
this.$refs.input.$el.focus(); this.$refs.input.$el.focus();
this.repeat(event, null, 1); this.repeat(event, null, 1);
event.preventDefault(); event.preventDefault();
}
}, },
onUpButtonMouseUp() { onUpButtonMouseUp() {
if (!this.$attrs.disabled) {
this.clearTimer(); this.clearTimer();
}
}, },
onUpButtonMouseLeave() { onUpButtonMouseLeave() {
if (!this.$attrs.disabled) {
this.clearTimer(); this.clearTimer();
}
}, },
onUpButtonKeyUp() { onUpButtonKeyUp() {
if (!this.$attrs.disabled) {
this.clearTimer(); 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) {
if (!this.$attrs.disabled) {
this.$refs.input.$el.focus(); this.$refs.input.$el.focus();
this.repeat(event, null, -1); this.repeat(event, null, -1);
event.preventDefault(); event.preventDefault();
}
}, },
onDownButtonMouseUp() { onDownButtonMouseUp() {
if (!this.$attrs.disabled) {
this.clearTimer(); this.clearTimer();
}
}, },
onDownButtonMouseLeave() { onDownButtonMouseLeave() {
if (!this.$attrs.disabled) {
this.clearTimer(); this.clearTimer();
}
}, },
onDownButtonKeyUp() { onDownButtonKeyUp() {
if (!this.$attrs.disabled) {
this.clearTimer(); this.clearTimer();
}
}, },
onDownButtonKeyDown(event) { onDownButtonKeyDown(event) {
if (event.keyCode === 32 || event.keyCode === 13) { if (event.keyCode === 32 || event.keyCode === 13) {