Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submenus are inaccessible via keyboard Enter/Space (Response::fake_primary_click) #5221

Open
fogti opened this issue Oct 4, 2024 · 0 comments · May be fixed by #5230
Open

Submenus are inaccessible via keyboard Enter/Space (Response::fake_primary_click) #5221

fogti opened this issue Oct 4, 2024 · 0 comments · May be fixed by #5230
Labels
bug Something is broken

Comments

@fogti
Copy link

fogti commented Oct 4, 2024

Describe the bug
When using Ui::menu inside of Ui::menu, although it is possible to enter the top-level menu using the Enter or Space key, there is apparently no (intuitive) way to enter a submenu inside of that menu via keyboard, it is only able to enter it via mouse, which is obviously bad from an accessibility perspective.

To Reproduce
Steps to reproduce the behavior:

  1. use the following in an appropriate location to setup a menu bar.
let mut tmp = false;
egui::TopBottomPanel::top("menu_bar")
    .show(ctx, |ui| {
        egui::menu::bar(ui, |ui| {
            ui.menu_button("X", |ui| {
                ui.menu_button("Y", |ui| {
                    ui.checkbox(&mut tmp, "Goal");
                });
            });
        });
    });
  1. Navigate to the menu button "X" using keyboard, open it via Enter
  2. Navigate to the submenu button "Y" using keyboard, in the now-open menu, observe that it can't be opened via Enter.

Expected behavior
The submenu should open when Enter is pressed on the keyboard.

Desktop (please complete the following information):

  • OS: Linux
  • Version: various; egui: 0.29.1 and master

Additional context
See also downstream bug: https://codeberg.org/topola/topola/issues/36 and demo/screencapture https://codeberg.org/attachments/4c923170-f824-4b7d-926c-54ac0622c395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
1 participant