From eeb501401a0c3e550fc338177b56f12a52f2ada7 Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Wed, 13 Nov 2024 04:00:37 -0500 Subject: [PATCH] fix confirmation prompt closing via rmb --- tui/src/confirmation.rs | 4 ++++ tui/src/float.rs | 5 ++++- tui/src/state.rs | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tui/src/confirmation.rs b/tui/src/confirmation.rs index 4b0c16f3..128aa43c 100644 --- a/tui/src/confirmation.rs +++ b/tui/src/confirmation.rs @@ -91,6 +91,10 @@ impl FloatContent for ConfirmPrompt { self.status = ConfirmStatus::Confirm; true } + MouseEventKind::Down(MouseButton::Right) => { + self.status = ConfirmStatus::Abort; + false + } MouseEventKind::ScrollDown => { self.scroll_down(); false diff --git a/tui/src/float.rs b/tui/src/float.rs index 2d235df3..afe32603 100644 --- a/tui/src/float.rs +++ b/tui/src/float.rs @@ -56,7 +56,10 @@ impl Float { pub fn handle_mouse_event(&mut self, event: &MouseEvent) -> bool { match event.kind { - MouseEventKind::Down(MouseButton::Right) => true, + MouseEventKind::Down(MouseButton::Right) => { + self.content.handle_mouse_event(event); + true + } _ => self.content.handle_mouse_event(event), } } diff --git a/tui/src/state.rs b/tui/src/state.rs index 2e56e13a..0a53f4c4 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -519,6 +519,7 @@ impl AppState { ConfirmStatus::None => {} } } + return true; } _ => {} }