From 6f01577d5f7f31dbabc0c36b7ea8520db4db9140 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 25 Apr 2021 18:20:10 +0200 Subject: [PATCH] Tab only selects labels if the `screen_reader` option is turned on. --- CHANGELOG.md | 1 + egui/src/context.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 094e5ec9..34f0e38f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ NOTE: [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md) and [ ### Changed 🔧 * Make `Memory::has_focus` public (again). * `Plot` must now be given a name that is unique within its scope. +* Tab only selects labels if the `screen_reader` option is turned on. ### Fixed 🐛 * Fix [defocus-bug on touch screens](https://github.com/emilk/egui/issues/288). diff --git a/egui/src/context.rs b/egui/src/context.rs index baae54c2..83bfa18e 100644 --- a/egui/src/context.rs +++ b/egui/src/context.rs @@ -202,7 +202,11 @@ impl CtxRef { return response; } - if sense.focusable { + // We only want to focus labels if the screen reader is on. + let interested_in_focus = + sense.interactive() || sense.focusable && self.memory().options.screen_reader; + + if interested_in_focus { self.memory().interested_in_focus(id); }