Skip to content

Commit

Permalink
update handle back button on android (#695)
Browse files Browse the repository at this point in the history
* update handle back button on androidf

* fix app not reload after tap back button
  • Loading branch information
JustinBeBoy authored Oct 24, 2024
1 parent d5a6cac commit b7018b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ func (win *Window) listenSoftKey(gtx C) {
// check for presses of the back key.
if runtime.GOOS == "android" {
for {
event, ok := gtx.Event(key.FocusFilter{Target: win},
key.Filter{Focus: win, Name: key.NameBack},
)
event, ok := gtx.Event(key.Filter{
Name: key.NameBack,
})
if !ok {
break
}
Expand All @@ -425,6 +425,7 @@ func (win *Window) listenSoftKey(gtx C) {
case key.Event:
if event.Name == key.NameBack && event.State == key.Press {
win.load.Theme.OnTapBack()
win.navigator.Reload()
}
}
}
Expand Down

0 comments on commit b7018b9

Please sign in to comment.