Fixed bug where a lost widget could still retain keyboard focus.
This commit is contained in:
parent
7cc5218630
commit
796def4bcb
2 changed files with 11 additions and 0 deletions
|
@ -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> {
|
||||||
|
|
Loading…
Reference in a new issue