[CommonUI] Problems with Focus, Selection and SetTriggerInputAction.. help, pls!

I sure hope you’ve solved it by now, but with CommonUI; no guarantee! I’ve found several posts with focus issues on CommonUI and I’ve had endless frustration wherein it’s hard to even explain what is going on.

My own problem is related to focus, and I found a fix. Hopefully somebody else will find it useful.

Issue

  • I would “open a menu” by adding it to an activatable stack (just like most tutorials do)
  • When menu is constructed, I would set focus to a button (SetFocus). E.g. basic stuff
  • So far so good
  • I then close the menu > and open it again
  • No focus anymore!
  • This would apply to any menu being added to the stack in any order. Always the second time it stops working

Fix

  • SetInputModeUIOnly when the first menu was added to stack. While this doesn’t sound unreasonable; why does it work the first time?
  • I should say: when the stack is empty (e.g. all menus closed) I would “SetInputModeGameOnly”, otherwise I can never control my character again. I find this more reasonable

Even these solutions pains me. I actually (for now, until I find a better way) run EventTick in the UI to see if the stack is empty or not to execute these commands.