# How to stop mouse click on the viewport to stealing focus from focused button?

**URL:** <https://forums.unrealengine.com/t/how-to-stop-mouse-click-on-the-viewport-to-stealing-focus-from-focused-button/2676945>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [November 20, 2025, 4:07pm UTC](https://forums.unrealengine.com/t/how-to-stop-mouse-click-on-the-viewport-to-stealing-focus-from-focused-button/2676945 "2025-11-20T16:07:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [November 20, 2025, 4:07pm UTC](https://forums.unrealengine.com/t/how-to-stop-mouse-click-on-the-viewport-to-stealing-focus-from-focused-button/2676945/1 "2025-11-20T16:07:25Z")

</div>

I have a simple menu, and the only thing focusable are the buttons, but whenever I click anywhere else on the viewport which aren’t buttons, whatever button is currently focused loses keyboard focus and I have to click a button with the mouse to regain focus.

How to prevent this from happening?

---

<div class="post-metadata">

**Author:** ![LegendGary](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LegendGary](https://forums.unrealengine.com/u/LegendGary)\
**Post date:** [November 21, 2025, 4:04am UTC](https://forums.unrealengine.com/t/how-to-stop-mouse-click-on-the-viewport-to-stealing-focus-from-focused-button/2676945/2 "2025-11-21T04:04:43Z")

</div>

set other Ui to not hit testable self so it wont get hit when you click it

---

<div class="post-metadata">

**Author:** ![fael097](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fael097/32/250778_2.png) [@fael097](https://forums.unrealengine.com/u/fael097)\
**Post date:** [November 22, 2025, 10:07pm UTC](https://forums.unrealengine.com/t/how-to-stop-mouse-click-on-the-viewport-to-stealing-focus-from-focused-button/2676945/3 "2025-11-22T22:07:06Z")

</div>

yeah for some reason that doesn’t work. I had to make a giant invisible button that covered the entire viewport behind the menu, and set it to focus on whatever was focused before clicking. janky, but works
