I would
-
set the input mode to UI only
-
have an invisible border that covers all the screen and overwrite input to handle everything
-
add everything else on top of that border
-
add this widget on top of the rest of the UI
-
On close: set input mode to Game and UI or whatever it was