mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
Fixed bug where a lost widget could still retain keyboard focus.
This commit is contained in:
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### Fixed 🐛
|
||||||
|
|
||||||
|
* Fixed bug where a lost widget could still retain keyboard focus.
|
||||||
|
|
||||||
## 0.3.0 - 2020-11-07
|
## 0.3.0 - 2020-11-07
|
||||||
|
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
|
|||||||
@@ -130,6 +130,13 @@ impl Memory {
|
|||||||
|
|
||||||
pub(crate) fn end_frame(&mut self) {
|
pub(crate) fn end_frame(&mut self) {
|
||||||
self.areas.end_frame();
|
self.areas.end_frame();
|
||||||
|
|
||||||
|
if let Some(kb_focus_id) = self.interaction.kb_focus_id {
|
||||||
|
if !self.used_ids.contains_key(&kb_focus_id) {
|
||||||
|
// Dead-mans-switch: the widget with kb focus has dissappeared!
|
||||||
|
self.interaction.kb_focus_id = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn layer_id_at(&self, pos: Pos2, resize_interact_radius_side: f32) -> Option<LayerId> {
|
pub fn layer_id_at(&self, pos: Pos2, resize_interact_radius_side: f32) -> Option<LayerId> {
|
||||||
|
|||||||
Reference in New Issue
Block a user