Widget loses focus when it never should to begin with

I have a simple widget with a few buttons and an input field. When I press F6 my actor, who received input, adds widget to viewport and focuses it, and then sets InputMode to UI only. At this point the Actor no longer can receive input from PC due to UI input mode so I set up Widget to close itself in OnKeyUp override. So far trivial stuff, really.
The issue arises when I try to focus and input any text in the input box - I immediately lose focus form my UserWidget and OnKeyUp event no longer can be triggered. I made sure I set up “Clear focus on commit” for the input box but no change. I even added few extra calls to focus functions that would immediately restore focus back to parent Widget but to no avail:

- once I click and input any text in Inputfield it is done deal and my OnKeyUp never processed.
What could be the issue?

Hey @Sarapuka!

Do you think we could get a wider look at your code here?
I think this part mostly looks fine, to determine anything we will likely need to see before and after this in the execution line :slight_smile:

That;s all:

Have you tried using SetFocus instead of SetUserFocus?

It tends to be more reliable.

You can see in my example I use it.

Ah I can see the confusion. Here:
Top is what you are using. Try the bottom one! :smiley:
image

Yes, that one works but it does not address whole issue - my main Widget still loses focus when I interact with an InputField that is INSIDE that widget. I want to be able to close the widget in 2 ways - either via keypress or via mouse click outside of widget bounds. Now, I can track when mouse leaves the widget area but I cant track clicks outside its space, there is no such functionality, at least not without doubling or tripling complexity of Ui setup with extra helpers and I want to keep it to single widget. So my approach was to check if Widget loses focus when mouse cursor confirmed to be outside its bounds and use it as a signal to close. But since for some reason my widget loses the focus even when I just interact with input box inside it I cant use this approach.

Something is broken, it reports both it lost main Focus and Focus Path but that is impossible, InputField is INSIDE my UserWidget, there is no way it would lose Focus path.