keyboard event update
parent
0cae7b2e84
commit
0cd90da5f4
|
@ -183,41 +183,37 @@ export default {
|
||||||
},
|
},
|
||||||
onKeyDown(event, index) {
|
onKeyDown(event, index) {
|
||||||
this.handleIndex = index;
|
this.handleIndex = index;
|
||||||
switch (event.which) {
|
switch (event.code) {
|
||||||
//down and left
|
case 'ArrowDown':
|
||||||
case 40:
|
case 'ArrowLeft':
|
||||||
case 37:
|
|
||||||
this.decrementValue(event, index);
|
this.decrementValue(event, index);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//up and right
|
case 'ArrowUp':
|
||||||
case 38:
|
case 'ArrowRight':
|
||||||
case 39:
|
|
||||||
this.incrementValue(event, index);
|
this.incrementValue(event, index);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//page down
|
case 'PageDown':
|
||||||
case 34:
|
|
||||||
this.decrementValue(event, index, true);
|
this.decrementValue(event, index, true);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//page up
|
case 'PageUp':
|
||||||
case 33:
|
|
||||||
this.incrementValue(event, index, true);
|
this.incrementValue(event, index, true);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//home
|
case 'Home':
|
||||||
case 36:
|
|
||||||
this.updateModel(event, this.min);
|
this.updateModel(event, this.min);
|
||||||
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//end
|
case 'End':
|
||||||
case 35:
|
|
||||||
this.updateModel(event, this.max);
|
this.updateModel(event, this.max);
|
||||||
|
event.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue