replace keyCode with key, fix #661

This commit is contained in:
Philipp Kühn 2020-04-11 00:12:19 +02:00
parent 5cb2bfeacc
commit 0228001aa4

View File

@ -103,18 +103,17 @@ export default {
}, },
// is called on every keyDown event while a suggestion is active // is called on every keyDown event while a suggestion is active
onKeyDown: ({ event }) => { onKeyDown: ({ event }) => {
// pressing up arrow if (event.key === 'ArrowUp') {
if (event.keyCode === 38) {
this.upHandler() this.upHandler()
return true return true
} }
// pressing down arrow
if (event.keyCode === 40) { if (event.key === 'ArrowDown') {
this.downHandler() this.downHandler()
return true return true
} }
// pressing enter
if (event.keyCode === 13) { if (event.key === 'Enter') {
this.enterHandler() this.enterHandler()
return true return true
} }