Gui.Button over Gui.TextArea does not work. Why?

I place a Gui.Button over a Gui.Textarea. And if i try to click it it always selects the Gui.Textarea under it.

Is there a way to solve this problem?

If your Button is in a separate `OnGUI` function, you could try playing around with `GUI.depth`. If it isn't, maybe you could try reordering which gets rendered first. You probably want the button after the textarea.

(really) hacky way to fix it quickly:

GUI.Button(blah);
GUI.TextArea(other blah);
GUI.Button(blah);

It uses the first button for input, the second to get drawn on top of the text box

The alternative is to handle the event catching yourself before the text box, use the event if it hits the button's position, and then call your if function and change the style of the button to make it look active