Skip to content

Commit

Permalink
Request focus on a TextEdit when clicked (#4991)
Browse files Browse the repository at this point in the history
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
#4941.
  • Loading branch information
Zoxc authored Aug 26, 2024
1 parent fd0ce5f commit f996b90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/egui/src/widgets/text_edit/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit f996b90

Please sign in to comment.