Skip to content

Commit

Permalink
And if nobody handles the event go back as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jul 29, 2023
1 parent 8b545a8 commit 38ad3a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/driver/mobile/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,12 @@ func (d *mobileDriver) typeDownCanvas(canvas *mobileCanvas, r rune, code key.Cod
canvas.Focused().TypedRune(r)
}
} else {
if keyName != "" && canvas.onTypedKey != nil {
canvas.onTypedKey(keyEvent)
if keyName != "" {
if canvas.onTypedKey != nil {
canvas.onTypedKey(keyEvent)
} else if keyName == mobile.KeyBack {
d.GoBack()
}
}
if r > 0 && canvas.onTypedRune != nil {
canvas.onTypedRune(r)
Expand Down

0 comments on commit 38ad3a2

Please sign in to comment.