Widget free space blocking elements from another Widget

I have a widget with GUI for main menu with buttons that will create new widgets or hide/show them if they were created already based on user input. I used create/hide/show method because I’m using those widgets on other levels as well (like settings widget which is the same in main menu as well as when you are playing the game and pausing game), also I went with hide/show to keep where the user was when it gets hidden, instead of remove/add which wouldn’t keep everything, also using Widget Switcher would have meant to create the widgets content on each level that is using them.

Now the problem that I have is that when the widget is first created it is working fine, but as soon as the widget gets hidden and then showed again later it covers other elements from GUI and become unusable.

Here is a example how it would work, by pressing Show button Widget is created if it wasn’t shown yet, or it will set visibility to true if it is hidden, while by pressing hide button, it will check if Widget is valid, if it is then it will check if Widget is visible, if it is then it will set visibility to false.

I can press Show first time, then I can press Hide as well, but after I press Show again, then Show and Hidden become unreachable, as if something is over them.

Widget

As you can see in Widget, I left at the bottom a space equal with Show/Hide buttons height so that it won’t interfere. Also there isn’t anything else below that white line, that is the lowest element in Widget. The only thing that is behind down there is the Canvas Panel which is child of the User Widget itself.

image