Open ManHunterGroms opened 5 years ago
I needed to create a toolbar inside a graph editor, and ran into this issue since I needed some string property fields. For anyone stumbling upon this, and since no other solutions came up while I was searching, here's my workaround:
public bool disableControls { get; set; }
public void Controls() {
if (disableControls) return;
....
var sidePanelRect = new Rect(0, 0, 300, window.position.height);
GUILayout.BeginArea(sidePanelRect);
_sidePanelScrollPos = GUILayout.BeginScrollView(_sidePanelScrollPos);
// Some editor gui stuff here
GUILayout.EndScrollView(); GUILayout.EndArea();
5. Finally, at the end of OnGUI, simply add:
```cs
window.disableControls = sidePanelRect.Contains(Event.current.mousePosition);
This will stop xNode from listening to mouse events while the cursor is over your custom toolbar, therefore fixing the text input issue.
When you try to set the cursor in the text field, the cursor disappears. If you always press the left mouse button, it worked. I guess it is due: https://github.com/Siccity/xNode/issues/50