Capture up and down keys for incrimenting numerical property
This commit is contained in:
parent
484c7a757e
commit
ec33812b52
1 changed files with 11 additions and 1 deletions
|
|
@ -28,7 +28,6 @@
|
||||||
type="number"
|
type="number"
|
||||||
:min="minimum"
|
:min="minimum"
|
||||||
:max="maximum"
|
:max="maximum"
|
||||||
@wheel="handleSpiner"
|
|
||||||
@input="grabFocus"
|
@input="grabFocus"
|
||||||
@focusout="focusOut"
|
@focusout="focusOut"
|
||||||
@keydown="keyDown"
|
@keydown="keyDown"
|
||||||
|
|
@ -378,6 +377,17 @@ export default {
|
||||||
if (event.keyCode == 13) {
|
if (event.keyCode == 13) {
|
||||||
this.sendValue();
|
this.sendValue();
|
||||||
}
|
}
|
||||||
|
// If numeric then capture Up and Down keys for incrementing.
|
||||||
|
if (this.dataType === "number") {
|
||||||
|
if (event.key === "ArrowUp") {
|
||||||
|
event.preventDefault();
|
||||||
|
this.increment(1);
|
||||||
|
}
|
||||||
|
if (event.key === "ArrowDown") {
|
||||||
|
event.preventDefault();
|
||||||
|
this.increment(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
updateIsEdited: function () {
|
updateIsEdited: function () {
|
||||||
this.isEdited =
|
this.isEdited =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue