From f215ab644e54822d3d94b6ca61a26966fe8eb67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Wed, 21 Aug 2024 17:47:56 +0200 Subject: [PATCH] Request focus on a TextEdit when clicked --- crates/egui/src/widgets/text_edit/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index 8205da63d0e..4659b1b2b66 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/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)); } }