Don't make labels focusable by default (#3937)

* Closes https://github.com/emilk/egui/issues/3910
This commit is contained in:
Emil Ernerfeldt 2024-02-01 18:08:36 +01:00 committed by GitHub
parent 67b796faee
commit 520b28ce22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}