Remove keyboard focus from a widget if something else is dragged

Closes https://github.com/emilk/egui/issues/618
This commit is contained in:
Emil Ernerfeldt 2021-12-30 23:24:29 +01:00
parent 753d709d3d
commit b00edfe97f

View file

@ -301,6 +301,11 @@ impl CtxRef {
memory.surrender_focus(id); memory.surrender_focus(id);
} }
if response.dragged() && !memory.has_focus(response.id) {
// e.g.: remove focus from a widget when you drag something else
memory.stop_text_input();
}
response response
} }