Skip to content

Commit

Permalink
Call cleanup before handlers for menu
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Jun 22, 2024
1 parent 73c0310 commit 5c33559
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/app_components/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ def _handle_buttondown(self, event: ButtonDownEvent):
self.menu_items[self.position % len(self.menu_items)]
)
if BUTTON_TYPES["CANCEL"] in event.button:
self._cleanup()
if self.back_handler is not None:
self.back_handler()
if BUTTON_TYPES["CONFIRM"] in event.button:
self._cleanup()
if self.select_handler is not None:
self.select_handler(
self.menu_items[self.position % len(self.menu_items)],
Expand Down

0 comments on commit 5c33559

Please sign in to comment.