Call OnMenuPress(nil) when hitting esc in a menu

OnMenuPress can already deal with the selected item being nil, so this allows us
to add common code to it that is run when cancelling the menu.
This commit is contained in:
Stefan Haller 2026-03-24 17:20:59 +01:00
parent 2ab78ad039
commit 7a0320b4ec

View file

@ -78,8 +78,7 @@ func (self *MenuController) close() error {
return nil
}
self.c.Context().Pop()
return nil
return self.context().OnMenuPress(nil)
}
func (self *MenuController) context() *context.MenuContext {