Skip to content

Commit

Permalink
Disable space shortcut when search bar is focused
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Jul 1, 2024
1 parent 2a6109e commit 365d02f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions egui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,9 @@ fn main_ui(
}

let mut try_popup = false;
ui.input(|input| {
if input.key_pressed(Key::Space) {
try_popup = true;
}
});
if ui.input(|input| input.key_pressed(Key::Space)) && ui.memory(|mem| mem.focused().is_none()) {
try_popup = true;
}

// TODO implement paste (by pressing enter or ctrl+N)
ScrollArea::vertical().show(ui, |ui| {
Expand Down

0 comments on commit 365d02f

Please sign in to comment.