Option to automatically select your first Item on Start (DropDownList & AutoCompleteComboBox)
parent
9ac4eb6969
commit
b315784caf
|
@ -112,11 +112,19 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
}
|
||||
|
||||
public bool SelectFirstItemOnStart = false;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
public void Start()
|
||||
{
|
||||
if (SelectFirstItemOnStart && AvailableOptions.Count > 0) {
|
||||
ToggleDropdownPanel (false);
|
||||
OnItemClicked (AvailableOptions [0]);
|
||||
}
|
||||
}
|
||||
|
||||
private bool Initialize()
|
||||
{
|
||||
|
|
|
@ -107,10 +107,15 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
}
|
||||
|
||||
public bool SelectFirstItemOnStart = false;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Initialize();
|
||||
if (SelectFirstItemOnStart && Items.Count > 0) {
|
||||
ToggleDropdownPanel (false);
|
||||
OnItemClicked (0);
|
||||
}
|
||||
}
|
||||
|
||||
private bool Initialize()
|
||||
|
|
Loading…
Reference in New Issue