Skip to content

Commit

Permalink
fix confirmation prompt closing via rmb
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx committed Nov 13, 2024
1 parent 563676d commit e583fc7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tui/src/confirmation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tui/src/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ impl<Content: FloatContent + ?Sized> Float<Content> {

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),
}
}
Expand Down
1 change: 1 addition & 0 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ impl AppState {
ConfirmStatus::None => {}
}
}
return true;
}
_ => {}
}
Expand Down

0 comments on commit e583fc7

Please sign in to comment.