unity-autocomplete-search-field icon indicating copy to clipboard operation
unity-autocomplete-search-field copied to clipboard

Problem having result window appear above other controls

Open thecrazy opened this issue 6 years ago • 6 comments

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?

thecrazy avatar May 03 '19 21:05 thecrazy

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

marijnz avatar May 03 '19 21:05 marijnz

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 avatar May 04 '19 00:05 thecrazy

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

thecrazy avatar May 04 '19 00:05 thecrazy

image

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

Mythique avatar Nov 19 '19 17:11 Mythique

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.

unrealbyte avatar Feb 04 '20 12:02 unrealbyte

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

RugbugRedfern avatar Jul 26 '21 00:07 RugbugRedfern