up and down arrows for movement

This commit is contained in:
Lachlan Kermode
2020-06-30 14:04:47 +02:00
parent 66bdb90454
commit 2e2b9e4442

View File

@@ -213,10 +213,12 @@ class Dashboard extends React.Component {
const idx = this.findEventIdx(ev)
switch (e.keyCode) {
case 37: // left arrow
case 38: // up arrow
if (idx <= 0) return
prev(idx)
break
case 39: // right arrow
case 40: // down arrow
if (idx < 0 || idx >= this.props.domain.length - 1) return
next(idx)
break