Bug fix: you can now use text edits again
@@ -206,10 +206,6 @@ impl CtxRef {
self.memory().interested_in_kb_focus(id);
}
- if response.has_kb_focus() && response.clicked_elsewhere() {
- self.memory().surrender_kb_focus(id);
- }
-
if sense.click
&& response.has_kb_focus()
&& (self.input().key_pressed(Key::Space) || self.input().key_pressed(Key::Enter))
@@ -220,6 +216,7 @@ impl CtxRef {
self.register_interaction_id(id, rect.min);
+ if sense.click || sense.drag {
let mut memory = self.memory();
memory.interaction.click_interest |= hovered && sense.click;
@@ -273,6 +270,7 @@ impl CtxRef {
}
}
}
+ }
if response.is_pointer_button_down_on {
response.interact_pointer_pos = self.input().pointer.interact_pos();
@@ -282,6 +280,10 @@ impl CtxRef {
response.hovered &= response.is_pointer_button_down_on; // we don't hover widgets while interacting with *other* widgets
}
+ if response.has_kb_focus() && response.clicked_elsewhere() {
+ self.memory().surrender_kb_focus(id);
+ }
+
response
}
