Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/7471-lucassurrender-focus-on |
Defaulting to At least on Chrome (MacOS) as well as some MacOS apps, the behavior seems to be to surrender focus on press (i.e. mouse down), not click. I found this because it also makes it hard to pass the focus to a new widget. E.g. if ui.button("Edit").clicked() {
editing = true;
// Pass focus to the TextEdit below
ui.memory_mut(|mem| mem.request_focus(ID));
}
if editing {
let response = TextEdit::singleline(...).id(ID).show(ui);
assert!(response.has_focus()); <--- Just to illustrate the issue
}In the code above, Having said that, I can see how |
* [X] I have followed the instructions in the PR template On touch devices you don't want the keyboard to disappear when scrolling, so this PR adds a `SurrenderFocusOn` enum to configure on what interaction to surrender focus.
On touch devices you don't want the keyboard to disappear when scrolling, so this PR adds a
SurrenderFocusOnenum to configure on what interaction to surrender focus.