From 26d43782a977b1b59f4a3e32ff8d62f2c338e6a6 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 1 Feb 2024 17:54:33 +0100 Subject: [PATCH] Don't make labels focusable by default --- 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); }