Browse Source

Request focus on a `TextEdit` when clicked (#4991)

This request focus on a TextEdit when clicked, so that touch events on
Android can now focus it.

This looks like a reasonable fix for
https://github.com/emilk/egui/issues/4941.
pull/5005/head
Zoxc 2 months ago
committed by GitHub
parent
commit
f996b9050e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      crates/egui/src/widgets/text_edit/builder.rs

2
crates/egui/src/widgets/text_edit/builder.rs

@ -576,7 +576,7 @@ impl<'t> TextEdit<'t> {
is_being_dragged,
);
if did_interact {
if did_interact || response.clicked() {
ui.memory_mut(|mem| mem.request_focus(response.id));
}
}

Loading…
Cancel
Save