Unfocus TextInput when Escape key is pressed

This commit is contained in:
Héctor Ramón Jiménez 2020-07-30 00:52:02 +02:00
parent 51c22f2426
commit 4ab9992bf8

View File

@ -468,6 +468,11 @@ where
self.state.cursor.select_all(&self.value); self.state.cursor.select_all(&self.value);
} }
} }
keyboard::KeyCode::Escape => {
self.state.is_focused = false;
self.state.is_dragging = false;
self.state.is_pasting = None;
}
_ => {} _ => {}
}, },
Event::Keyboard(keyboard::Event::KeyReleased { Event::Keyboard(keyboard::Event::KeyReleased {