From 9759f3626f7df67c766f57dee83f0ab6cea91d5a Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Thu, 29 Feb 2024 01:01:02 -0500 Subject: [PATCH] Close dialog on escape --- src/dialog.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dialog.rs b/src/dialog.rs index 237e4d8..e1e5898 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -429,6 +429,10 @@ impl Application for App { Command::none() } + fn on_escape(&mut self) -> Command { + self.update(Message::Cancel) + } + /// Handle application events here. fn update(&mut self, message: Message) -> Command { match message {