Arrow keys do not navigate menus well when there are buttons behind them.
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Describe the bug**
When there are buttons (or otherwise selectable elements) behind a menu, using arrow keys will give focus to those elements instead. This is especially prevalent with sub-menus, but seems to apply more generally there
**To Reproduce**
Steps to reproduce the behavior:
1. Use the egui demo app or [website](https://www.egui.rs/#demo)
2. Open the "Popups" demo
3. Get keyboard focus to the "Click, right-click and hover me!" button (which is also weird that this is a step: normally I would expect clicking on a button to move my keyboard focus there and immediately use arrow keys to navigate the menus
4. Go up and down the menu or to sub-menus and back. Focus will sometimes shift to the `RectAlign` buttons behind the menu (and a whole bunch of other options)
**Expected behavior**
Focus should stay in the menu as long as it's open
**Desktop (please complete the following information):**
- OS: Linux
(reproducible running in the demo app locally on `main`, and in the [official demo website](https://www.egui.rs/#demo) with firefox)
**Additional context**
This seems on the edge of a feature request and bug, but bug seemed a little more accurate. This seems to be more of a problem for screen reader users, since they're more likely to be dependent on keyboard navigation, but it's annoying for everyone who wants to use arrow keys.
Contributor guide
Research direction
Reproduce the issue in the egui demo app by opening the Popups demo and navigating with arrow keys, including the RectAlign buttons behind the menu. Start by tracing the menu keyboard-focus handling from that demo; done means focus remains within an open menu and its sub-menus, including in the official demo website with Firefox.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- accessibility
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100