Fix reorderable lists

pull/413/head
Leon Kyz 2018-03-30 20:00:26 +03:00
parent 62de3d3d44
commit 3cd7b25707
2 changed files with 15 additions and 3 deletions

View File

@ -67,6 +67,15 @@ namespace UnityEngine.UI.Extensions
return canvas;
}
/// <summary>
/// Refresh related list content
/// </summary>
public void Refresh()
{
_listContent = ContentLayout.gameObject.AddComponent<ReorderableListContent>();
_listContent.Init(this);
}
private void Awake()
{
@ -85,8 +94,7 @@ namespace UnityEngine.UI.Extensions
return;
}
_listContent = ContentLayout.gameObject.AddComponent<ReorderableListContent>();
_listContent.Init(this);
Refresh();
}
#region Nested type: ReorderableListEventStruct

View File

@ -227,6 +227,10 @@ namespace UnityEngine.UI.Extensions
_reorderableList.OnElementAdded.Invoke(args);
// Force refreshing both lists because otherwise we get inappropriate FromList in ReorderableListEventStruct
_reorderableList.Refresh();
_currentReorderableListRaycasted.Refresh();
if(!isValid) throw new Exception("It's too late to cancel the Transfer! Do so in OnElementDropped!");
}