Closed white-axe closed 10 months ago
It turns out this bug is being caused by this context menu. Disabling it by using .tab_context_menus(false)
when creating the DockArea
fixes it.
https://github.com/Adanos020/egui_dock/blob/fae7fbc9483ed62fd982c88201a7f8f1b4563559/src/widgets/dock_area/show/leaf.rs#L312-L345
I'll see if I can figure out how to fix the bug without disabling the context menu.
Describe the bug Egui allows users to focus widgets using the keyboard, i.e. selecting focusable widgets like buttons, using the Tab key to navigate in forward order or Shift+Tab to navigate in reverse order. However, widgets in an egui_dock tab will only be navigable in this way if the user uses Shift+Tab. Pressing the Tab key does not work.
To Reproduce Replace the
ui.label(format!("Content of {tab}"));
here in the "simple" example withlet _ = ui.button(format!("Content of {tab}"));
and then run it. https://github.com/Adanos020/egui_dock/blob/c3604425943d9c5f922a8b9aba8e5a5b89e785e9/examples/simple.rs#L26When holding down Shift+Tab, the focus cycles between the buttons inside the tabs.
When holding down the Tab key alone, nothing happens.
Expected behavior When holding down the Tab key, the focus should cycle between the buttons in the reverse of the order that Shift+Tab cycles the buttons in.
Screenshots This is what's supposed to happen when holding Tab, but in reverse order: