Close popups also with <ENTER>

This commit is contained in:
ChristianVisintin
2020-12-25 10:00:24 +01:00
parent 96a395615b
commit 76c4f1b67f
2 changed files with 12 additions and 21 deletions

View File

@@ -405,7 +405,7 @@ impl AuthActivity {
pub(super) fn handle_input_event_mode_popup_alert(&mut self, ev: &InputEvent) {
// Only enter should be allowed here
if let InputEvent::Key(key) = ev {
if let KeyCode::Enter = key.code {
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
self.input_mode = InputMode::Form; // Hide popup
}
}
@@ -417,12 +417,9 @@ impl AuthActivity {
pub(super) fn handle_input_event_mode_popup_help(&mut self, ev: &InputEvent) {
// If enter, close popup
if let InputEvent::Key(key) = ev {
match key.code {
KeyCode::Enter | KeyCode::Esc => {
// Set input mode back to form
self.input_mode = InputMode::Form;
}
_ => { /* Nothing to do */ }
if matches!(key.code, KeyCode::Esc | KeyCode::Enter) {
// Set input mode back to form
self.input_mode = InputMode::Form;
}
}
}