kufu/hello-world

KeyboardEvent.keyCode is deprecated

is2ei opened this issue ยท 0 comments

is2ei commented

KeyboardEvent.keyCode is deprecated and no longer recommended to use. ๐Ÿ˜…

if (e.keyCode === 38) {
e.preventDefault()
if (currentIndex === 0) {
setIndex(commandNames.length - 1)
} else {
setIndex(currentIndex - 1)
}
}
// down
if (e.keyCode === 40) {

Ref: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode