diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 44dc58e695a9..fa9be404cc61 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -342,8 +342,8 @@ impl State { } WindowEvent::KeyboardInput { event, .. } => { // When pressing the Tab key, egui focuses the first focusable element, hence Tab always consumes. - let consumed = self.on_keyboard_input(event) - || self.egui_ctx.wants_keyboard_input() + let consumed = (self.egui_ctx.wants_keyboard_input() + && self.on_keyboard_input(event)) || event.logical_key == winit::keyboard::Key::Named(winit::keyboard::NamedKey::Tab); EventResponse {