From 2afb7c1975db3e2f15ef2676464dc345d90260a8 Mon Sep 17 00:00:00 2001 From: Atbrakhi Date: Tue, 29 Aug 2023 11:27:53 +0200 Subject: [PATCH] make enter key equivalent to go button when location field is focused (#30126) --- ports/servoshell/minibrowser.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/servoshell/minibrowser.rs b/ports/servoshell/minibrowser.rs index 4fe9a6c4b12..0ebccaab9bd 100644 --- a/ports/servoshell/minibrowser.rs +++ b/ports/servoshell/minibrowser.rs @@ -66,6 +66,10 @@ impl Minibrowser { if ui.input(|i| i.clone().consume_key(Modifiers::COMMAND, Key::L)) { location_field.request_focus(); } + if location_field.lost_focus() && ui.input(|i| i.clone().key_pressed(Key::Enter)) { + event_queue.borrow_mut().push(MinibrowserEvent::Go); + location_dirty.set(false); + } }, ); });