Skip to content

gpui: Add tab focus support #33008

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

huacnlee
Copy link
Contributor

@huacnlee huacnlee commented Jun 19, 2025

Release Notes:

  • N/A

With a tab_index and tab_stop option to FocusHandle to us can switch focus by Tab, Shift-Tab.

The tab_index is from WinUI and HTML tabindex, only the tab_stop is enabled that can be added into the tab_handles list.

  • Added window.focus_next() and window.focus_previous() method to switch focus.
  • Added tab_index to InteractiveElement.
cargo run -p gpui --example tab_stop
Screen.Recording.2025-06-19.at.18.48.02.mov

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 19, 2025
@huacnlee huacnlee marked this pull request as ready for review June 19, 2025 07:06
@mikayla-maki
Copy link
Member

omg! Thank you!

@huacnlee
Copy link
Contributor Author

Apply this in GPUI Component, now focus management is very easy.

Screen.Recording.2025-06-19.at.16.53.41.mov

@danilo-leal
Copy link
Contributor

This is fantastic! 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants