Skip to content

Commit

Permalink
Fixed errors in key input example.
Browse files Browse the repository at this point in the history
  • Loading branch information
michielvandergeest committed Feb 26, 2024
1 parent b4d3c66 commit 52b606e
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/pages/KeyInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,13 @@ export default Blits.Component('KeyInput', {
},
},
input: {
left(e) {
left() {
const focusedX = this.focusedX - 1
if (focusedX === -1) {
this.parent.focus(e)
} else {
this.focusedX = Math.max(focusedX, 0)
}
this.focusedX = Math.max(focusedX, 0)
},
right(e) {
right() {
const focusedX = this.focusedX + 1
if (focusedX === 4) {
this.parent.focus(e)
} else {
this.focusedX = Math.min(focusedX, 3)
}
this.focusedX = Math.min(focusedX, 3)
},
up() {
this.focusedY = Math.max(this.focusedY - 1, 0)
Expand Down

0 comments on commit 52b606e

Please sign in to comment.