Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem having result window appear above other controls #1

Open
thecrazy opened this issue May 3, 2019 · 6 comments
Open

Problem having result window appear above other controls #1

thecrazy opened this issue May 3, 2019 · 6 comments

Comments

@thecrazy
Copy link

thecrazy commented May 3, 2019

The result window appears bellow the other controls in my editor window.

Anyway to fix this? I could modify your code to take a rect but I just wasted 2 days modifying another implementation of a search field for the same problem and I ended up having issues with the mouse clicks going through the result popup and initiating clicks on controls under it instead.

Same thing will happen here if I go that route.

Suggestions?

@marijnz
Copy link
Owner

marijnz commented May 3, 2019

Could you share a screenshot to illustrate the problem? I'm not fully understanding what you're saying.

@thecrazy
Copy link
Author

thecrazy commented May 4, 2019

I wanted to send a screenshot but for some reason windows wont cooperate.

I will try to rephrase:
The autocomplete suggestions appears under the GUI controls that are drawn later in OnGui

So if we have somthing like (pseudocode):

void OnGUI() {
autocompleteSearchField.OnGUI();
scrollview
button
etc...
}

The dropdown widow created by your control to show the autocomplete results gets drawn under the scrollview and buttons.

I made quick sketch.

The gray area is the editor window
Yellow is the auto complete search field
Blue is the scroll view
And red is the dropdown with the autocomplete results delimited with dashes were its hidden

SuperDuperDrawingSkills

@thecrazy
Copy link
Author

thecrazy commented May 4, 2019

I modified one of your examples to show the problem see the attachment.

Note that I had to rename it to .txt to be able to attach it.

AssetDatabaseSearchExample.cs.txt

@Mythique
Copy link

image

Same issue for me when using the code in Editor.OnInspectorGUI().

@unrealbyte
Copy link

After small research I did, the elements are rendered in the order of the code, without the possibility of defining z-index parameters as in CSS.

Workaround: In AutocompleteSearchField.cs, add to line 144:

EditorGUILayout.Space(20);

I know it's not the best behaivour and removes the "floating" effect, but works fine.

@RugbugRedfern
Copy link

Had the same issue, adding
EditorGUILayout.Space(300);
to line 144 in AutocompleteSearchField worked for me, thanks! Not the most elegant solution but it's good enough.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants