Skip to content

Commit

Permalink
make enter key equivalent to go button when location field is focused (
Browse files Browse the repository at this point in the history
  • Loading branch information
atbrakhi committed Aug 29, 2023
1 parent da64144 commit 2afb7c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ports/servoshell/minibrowser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},
);
});
Expand Down

0 comments on commit 2afb7c1

Please sign in to comment.