Skip to content

Commit

Permalink
"New Folder" bugfix for later Unity versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirkula committed Oct 27, 2020
1 parent a234c6b commit 4476eda
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,8 @@ private IEnumerator CreateNewFolderCoroutine()
listView.UpdateList();
}

filesScrollRect.movementType = ScrollRect.MovementType.Unrestricted;

// The easiest way to insert a new item to the top of the list view is to just shift
// the list view downwards. However, it doesn't always work if we don't shift it twice
yield return null;
Expand All @@ -1444,6 +1446,7 @@ private IEnumerator CreateNewFolderCoroutine()
( (RectTransform) renameItem.transform ).anchoredPosition = new Vector2( 1f, itemHeight );
renameItem.Show( string.Empty, selectedFileColor, folderIcon, ( folderName ) =>
{
filesScrollRect.movementType = ScrollRect.MovementType.Clamped;
filesContainer.anchoredPosition = Vector2.zero;

if( string.IsNullOrEmpty( folderName ) )
Expand Down

0 comments on commit 4476eda

Please sign in to comment.