User created widget cannot detect it has focus when using up and down arrow keys
I have a vertical box which comprises of a user created widget called “Menu Option”. “Menu Option” consists of a button and text.
This widget is placed within another widget, my menu. When the menu is constructed, I set the focus to one of my “Menu Option” widgets.
The menu looks something like this:
As you can see, I placed a text to display the name of the object which currently has keyboard focus. The “Menu Option” which I set as ‘In Widget to Focus’ when setting Input mode UI only (as seen in previous picture) recognises it has current focus. When I use the arrow keys however, to navigate between the options, the currently selected widget fails to detect it has focus even though there is a dotted line around it. The text remains as MenuOption instead of MenuOption_0, MenuOption_1 etc.
This is what I’m using to check whether the widget has focus or not:
I made sure that my user created widget has ‘Is Focusable’ set to true.
------------------------ What I have tried: --------------------------
When I set up a vertical box comprised of normal buttons (as seen in the menu picture), they are able to detect focus fine! The outputted text changes to the name of the button that currently has focus.
I want to use a list of user created widgets rather than normal buttons because it stores animations which I want to apply to all instances of this widget.
Follow this question
Once you sign in you will be able to subscribe for any updates here