Fix: you can again click slider values to edit them

This commit is contained in:
Emil Ernerfeldt 2020-11-13 12:50:05 +01:00
parent 92b1257ec3
commit 9057eaec7e
1 changed files with 5 additions and 1 deletions

View File

@ -136,7 +136,11 @@ impl Memory {
self.areas.end_frame();
if let Some(kb_focus_id) = self.interaction.kb_focus_id {
if !self.used_ids.contains_key(&kb_focus_id) {
// Allow calling `request_kb_focus` one frame and not using it until next frame
let recently_gained_kb_focus =
self.interaction.kb_focus_id_previous_frame != Some(kb_focus_id);
if !recently_gained_kb_focus && !self.used_ids.contains_key(&kb_focus_id) {
// Dead-mans-switch: the widget with kb focus has dissappeared!
self.interaction.kb_focus_id = None;
}