Tab order when displaying popups next to a widget #7498
Unanswered
puremourning
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a widget that's using the
egui_autocomplete
crate to add a popup with suggestions for an input box.This crate uses
egui::Popup
to render a list of suggestions below a single lineTextEdit
. This works OK for the most part.However, the one main quirk is that the "tab order" (the notional
FocusDirection::Next
) seems to be somewhat arbitrary when tabbing out of the text edit.I created the following minimal example to demonstrate what's happening:
In this example we have simply 3 text edits in a vertical line (ok one is in a bottom panel, but from the user perspective, they are just a column-of-three).
The first text edit has configuration to show the popup whenever it is focussed. The popup does nothing in this example.
The expectation is that pressing tab repeatedly would cycle through the 3 text inputs from top to bottom, and then round again, but actually if you :
You are in no-mans land..no input is focussed.
Though oddly if you click the 2nd input, then tab, tab. it does cycle more normally.
So the question is: When employing a popup like this that activates when an input is focussed, and deactivates when it loses focus (e.g. via tab), is there a way to retain a "natural" tab order? in this case?
I tried a number of different ways and it seems a little unpredictable. Any advice much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions