-
Notifications
You must be signed in to change notification settings - Fork 261
feat: add FocusManager for keyboard navigation #137
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: main
Are you sure you want to change the base?
Conversation
|
What about having a tabIndex on Renderables to control what should be "tabable" and what not? Would then also work with custom Renderables. |
|
Right now, a Renderable is considered tabbable if it has If we wanted to change this and allow What’s your opinion? |
|
I am a bit concerned about tree traversal for finding tabables, as that might also traverse long lists with potentially thousands of nodes and block the process. I would make that a built-in collector, on the RenderContext add methods to collect the focusable when it is added to the tree and remove it from the list when removed from the tree. Then it's just fast iteration on a small list, compared to tree traversal. |
|
something like creating a secondary tree? |
|
Just a list of Renderables, sorted by tabIndex. Doesn't matter where in the tree they are then, can still check if visible or not and take the next/prev available visible renderable to focus. |
focus-manager.mp4