Don’t use the UI only node. To disable game input and focus solely on the widget, do the following:
Turn this setting on in your widget:
Put this node in your widget blueprint.
In my case, I have AbilityMenu assigned in my input settings. So when the key assigned to that action name is pressed, it will fire CloseWidget and close this menu.