Tab only selects labels if the screen_reader option is turned on.

This commit is contained in:
Emil Ernerfeldt 2021-04-25 18:20:10 +02:00
parent c2744a1437
commit 6f01577d5f
2 changed files with 6 additions and 1 deletions

View file

@ -18,6 +18,7 @@ NOTE: [`eframe`](eframe/CHANGELOG.md), [`egui_web`](egui_web/CHANGELOG.md) and [
### Changed 🔧 ### Changed 🔧
* Make `Memory::has_focus` public (again). * Make `Memory::has_focus` public (again).
* `Plot` must now be given a name that is unique within its scope. * `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 🐛 ### Fixed 🐛
* Fix [defocus-bug on touch screens](https://github.com/emilk/egui/issues/288). * Fix [defocus-bug on touch screens](https://github.com/emilk/egui/issues/288).

View file

@ -202,7 +202,11 @@ impl CtxRef {
return response; 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); self.memory().interested_in_focus(id);
} }