Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created June 15, 2026 09:11
Show Gist options
  • Select an option

  • Save unitycoder/2799b5e1fc2a0cf62973ebafdd5fcd43 to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/2799b5e1fc2a0cf62973ebafdd5fcd43 to your computer and use it in GitHub Desktop.
Editor Window Deselect textarea element on click
// if mouse click anywhere on window
var theWholeWindowRect = new Rect(0, 0, position.width, position.height);
if (GUI.Button(theWholeWindowRect, "", GUIStyle.none))
{
GUI.FocusControl(null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment