UMG Focus is Lost When Clicking on "Visible" Widgets

Focus is lost when clicking on widgets, even those marked as Visible. Buttons seem to be the only exception.

UI mode is set to Game and UI.

Hi,

what do you mean with “focus lost”? You mean the widget gets the focus when you click on it? Or you don’t want a click to go through the widget to the game? In the second case, you could override the mouse click function and set the return value to handled.

Can you explain it a bit more?

Regards,

Hello,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved?
  4. Could you (as Priximan suggested) elaborate further on what you mean by the focus is lost and about how this is inverse to the expected result?

Hello,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

I’m experiencing this too
On the image that I have some buttons on the left with keyboard focus on the “return to game” button.
If I click anywhere on the screen the buttons lose the focus

Hello gustavorios2,

Could you go through and answer the questions from my previous post that were directed at?

hi! thanks for the quick response.

I made a empty project explaining the widget strange behavior.
heres the link
link text

Maybe I’m just missing something.

THanks!

Hello gustavorios2,

After taking a quick look at your project, it appears that you will need to manage your inputs. I made the change below (set input mode ui only) and this appears to have resolved the issues mentioned in the project. I hope that this information helps.

Make it a great day

bIsFocusable = true; ?

I give my solution, I hope it will help you (and the other people who come to this forum and were looking for the solution like me, 30 minutes ago, before I found this little trick! ^^)

1- record the focused button in the Event Tick

2- Create a giant, invisible button, without pressed padding, which contains the entire menu.

3- When clicking on this giant invisible button (OnPress, not OnClick), set the focus to the current focused button

It works perfectly for me! ^^
Final result: https://streamable.com/kwm4c

Tip: you can remove the default dotted frame around the button by disabling this feature in project settings:

I was having the same issue. But adding only the Show Mouse Cursor enabled changed everything

I’m not sure this is a great solution but in my case, I set the focus back when it’s lost (due to mouse click):

image