Clicking changes focus from widget to viewport

My menu support Keyboard, Mouse an gamepad very well.

I copy the text of my answer I wrote here : https://answers.unrealengine.com/questions/331759/umg-focus-is-lost-when-clicking-on-visible-widgets.html?childToView=906845#answer-906845

"

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:

"