Abort input using <ESC>

This commit is contained in:
ChristianVisintin
2020-11-27 16:47:46 +01:00
parent 6f7f81264a
commit 266a9be524

View File

@@ -592,6 +592,13 @@ impl FileTransferActivity {
match ev { match ev {
InputEvent::Key(key) => { InputEvent::Key(key) => {
match key.code { match key.code {
KeyCode::Esc => {
// Abort input
// Clear current input text
self.input_txt.clear();
// Set mode back to explorer
self.input_mode = InputMode::Explorer;
}
KeyCode::Enter => { KeyCode::Enter => {
// Submit // Submit
let input_text: String = self.input_txt.clone(); let input_text: String = self.input_txt.clone();