From 520b28ce22a0daa20e13767af6061e9e40796f2a Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 1 Feb 2024 18:08:36 +0100 Subject: [PATCH] Don't make labels focusable by default (#3937) * Closes https://github.com/emilk/egui/issues/3910 --- crates/egui/src/widgets/label.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/label.rs b/crates/egui/src/widgets/label.rs index b68fb4337e1..f5bb7ac425a 100644 --- a/crates/egui/src/widgets/label.rs +++ b/crates/egui/src/widgets/label.rs @@ -130,11 +130,12 @@ impl Label { // we prioritize touch-scrolling: let allow_drag_to_select = ui.input(|i| !i.any_touches()); - let select_sense = if allow_drag_to_select { + let mut select_sense = if allow_drag_to_select { Sense::click_and_drag() } else { Sense::click() }; + select_sense.focusable = false; // Don't move focus to labels with TAB key. sense = sense.union(select_sense); }