1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Bind up/down to prev/next event; closes #1167

This commit is contained in:
Sander Steenhuis
2018-02-26 16:20:45 +01:00
parent 6502158716
commit 5b8519b2b8

View File

@@ -59,6 +59,18 @@ class TopBar extends React.Component {
return this.handleSearchClearButton(e)
}
// Next note on DOWN key
if (e.keyCode === 40) {
ee.emit('list:next')
e.preventDefault()
}
// Prev note on UP key
if (e.keyCode === 38) {
ee.emit('list:prior')
e.preventDefault()
}
// When the key is an alphabet, del, enter or ctr
if (e.keyCode <= 90 || e.keyCode >= 186 && e.keyCode <= 222) {
this.setState({