[How to move this thread to “Script” session?]
here is the story, I tried to create the auto complete popup for my Editor tools kit. (following gif)
as the images shown, when the “popup” that I make show on top of another EditorGUI.
something wired happen,
- I can’t really click on the “Top” button, click will focus the EditorGUI behind it.
in this case:
if any textfield are lay behind the button, mouse click will focus on the textfield “Behind”,
instead of the button on “Top” of it. - Cursor (Mouse), it also display as a Cursor.Text instead of Cursor.Hand
- The popup working fine, if there is nothing allow to interact behind.

some article are saying the GUI.Depth are used to solve the issue, however it didn’t work on my cases.
here is how I implement it.
// Draw recommend keyward(s)
if (m_CacheCheckList.Count > 0)
{
int cnt = m_CacheCheckList.Count;
float height = cnt * EditorGUIUtility.singleLineHeight;
Rect area = position;
area = new Rect(area.x, area.y - height, area.width, height);
GUI.depth-=10;
// GUI.BeginGroup(area);
// area.position = Vector2.zero;
GUI.BeginClip(area);
Rect line = new Rect(0, 0, area.width, EditorGUIUtility.singleLineHeight);
for (int i = 0; i < cnt; i++)
{
if (GUI.Button(line, m_CacheCheckList[i]))//, EditorStyles.toolbarDropDown))
{
rst = m_CacheCheckList[i];
GUI.changed = true;
GUI.FocusControl(""); // force update
}
line.y += line.height;
}
GUI.EndClip();
//GUI.EndGroup();
GUI.depth+=10;
}
so any idea how to workaround the problem ?
for anyone who interested to review the full source code,
there is the link in my blog.
http://www.clonefactor.com/wordpress/public/1769/
