-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Outline focused element when tab is pressed. #16798
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
base: master
Are you sure you want to change the base?
Conversation
|
I haven't tried this out yet. But I'd make sure the outline only appears when the keyboard or gamepad is used to focus, and not when clicking or otherwise focusing |
|
That's exactly what it does: the outline appears when pressing tab with or without shift and disappears when clicking somewhere with the mouse. It does not appear when pressing ctrl and tab. |
|
In my opinion #14531 can be addressed in a follow-up PR. |
This comment was marked as outdated.
This comment was marked as outdated.
I would say no, "previous" and "next" should be symmetric. |
|
I agree and fixed this in dff25c2. This should be ready for a second round of reviews then. |
I think ideally there should be a formspec way of styling the color and maybe the thickness, for two reasons: In a light (white) style, the outline might be barely noticeable; game developers might want the outline to fit in with the color scheme of their menus. But it's probably fine to add such an option later? 2px thickness seems ok to me, though of course it depends a bit on screen resolution. |
This comment was marked as outdated.
This comment was marked as outdated.
|
If we allow styling, it should still be possible for users to override to make it very obvious for accessibility reasons Also we have a focus selector for buttons already, but no focus-visible selector or an outline style property |
|
The feature works as described - but unlike in other apps (e.g. webbrowser), the focussed element is not actively brought into the visible part of the frame. |
autoscroll.mp4 |
autoscroll_vert.mp4 |
This comment was marked as outdated.
This comment was marked as outdated.
SmallJoker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works

Add compact, short information about your PR for easier understanding:
Note
I used an LLM Chatbot/Assistant during development, but I take full responsibility for the submitted changes.
Improve keyboard-only navigation by outlining the currently focused element.
Future gamepad support would also benefit from this.
This PR adds a hard-coded white rectangle, which appears around the next focused element when tab is pressed.
Addresses Show GUI element focus #16137
Closes Allow keyboard only use of formspecs #11392
Related Formspec buttons mega-issue #14425
Not directly, maybe 2.3.
This is an industry standard: OSes like Android or Windows and many applications, e.g., Firefox, have very similar functionality. It makes it easier to figure out which element is focused.
Disclosed.
To do
This PR is ready for review.
How to test
open luanti → press tab/shift+tab → observe that the focused element is outlined in white
Preview
2026-01-02.13-43-35.mp4