From 7ed14e8838bafbfc9b41eb4e0be985ac172514f4 Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Wed, 27 Jul 2022 12:01:08 -0500 Subject: [PATCH] Fix focus behavior when pressing Tab with no focus --- CHANGELOG.md | 1 + egui/src/memory.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be9ee630b10..6c5d4891776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui-w * Fixed `Plot` auto-bounds bug ([#1599](https://github.com/emilk/egui/pull/1599)). * Fixed dead-lock when alt-tabbing while also showing a tooltip ([#1618](https://github.com/emilk/egui/pull/1618)). * Fixed `ScrollArea` scrolling when editing an unrelated `TextEdit` ([#1779](https://github.com/emilk/egui/pull/1779)). +* Fixed focus behavior when pressing Tab in a UI with no focused widget ([#1861](https://github.com/emilk/egui/pull/1861)). ## 0.18.1 - 2022-05-01 diff --git a/egui/src/memory.rs b/egui/src/memory.rs index 497b9707426..4286a16012a 100644 --- a/egui/src/memory.rs +++ b/egui/src/memory.rs @@ -298,6 +298,7 @@ impl Focus { } else if self.pressed_tab && self.id == None && !self.give_to_next { // nothing has focus and the user pressed tab - give focus to the first widgets that wants it: self.id = Some(id); + self.pressed_tab = false; } self.last_interested = Some(id);