mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 02:59:01 +08:00
replace keyCode with key, fix #661
This commit is contained in:
parent
5cb2bfeacc
commit
0228001aa4
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user