Replies: 4 comments 1 reply
-
There is no way to programmatically get the next or previous focused element currently. Is there some API for that in HTML DOM? In any case, next and previous sibling should work for what they do. However, you need to first know which node is focused in the DOM tree. You may need to walk up the parents to find your table cell, and then go to its sibling, and then check the descendants of that and so on. You can view the entire code for how we do this and determine the next node in You could also consider using your own solution with a certain class name for all elements one can navigate to, and then easily fetch the list with |
Beta Was this translation helpful? Give feedback.
-
@mikke89 appreciate the prompt response. I am trying to build a generic solution that would work with tables and other unknown or layouts or hierarchies. The clean way to do that would be to somehow retrieve the focus list / tab-index list. As you mentioned above.. There are some challenges with that. The naming pattern could be one approach. The other way is to try and build the navigable list on document load or something along those lines. Was hoping for an easy solution.. But there doesn't seem to be one. I'll give it more thought. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks. Will take a look at that. |
Beta Was this translation helpful? Give feedback.
-
FYI.. Came across this github thread which is trying to solve a similar problem and has some interesting discussions. |
Beta Was this translation helpful? Give feedback.
-
I am trying to add gamepad support for navigating through the UI, and am running into a problem.
I have a set of buttons (custom class) in a table (multiple rows).
I have the tab-index set to auto, and I can tab through them using the tab button on the keyboard.
The problem is, if I try to control navigation programmatically, I get null for focused_element->GetNextSibling() and Get PreviousSibling().
Is there an easy way to retrieve the focus list (tab-index sequence and elements), in which case I can try to manage this myself?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions