hey thanks @Mind-Brain for the response.
I’m afraid this might be very difficult to solve, though I’ll describe as much as I know here:
all buttons are focusable. They are derived from CommonButtonBase (not generic buttons).
I have an event which adds new buttons to a wrap box (and clears old ones). Most of the time the event fires, focus is lost and ends up on the viewport (so says widget reflector) even though I have the following code in the Get Desired Focus target override:
This code is saying, if there is a button in the wrap box, focus on it, otherwise focus on another button which is always visible.
Another detail:
If I fire up the game (PIE or standalone) and I do not click in the game, I can fire this event (a gamepad or keyboard key) and focus is never lost. But once I click into the game, then if I press the event firing key, then focus will be lost after the event fires.
In Level Editor Play settings I have Game Gets Mouse Control set true:
The game viewport client class is common ui one:
If I am using a controller only, widget reflect indicates that a button in the wrap box is focused, however D-pad navigation won’t work until i press the confirm button. Then, after that, it is similar to if i had mouse clicked - focus is lost after pressing the keys which fire the event that removes old buttons and creates new ones.
If there are any Common UI experts I’m happy to pay for a few hours to help solve this (and understand why it’s happening in first place)