Skip to content

Commit

Permalink
fix to ensure items returned by key, are sorted as per the keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendy committed Apr 17, 2017
1 parent 87bbb93 commit 7572460
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/nuPickers/Shared/Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using nuPickers.Shared.TypeaheadListPicker;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;

internal static class Editor
{
Expand Down Expand Up @@ -78,6 +79,9 @@ internal static IEnumerable<EditorDataItem> GetEditorDataItems(
editorDataItems = new CustomLabel(customLabelMacro, currentId, propertyAlias)
.ProcessEditorDataItems(editorDataItems);
}

// ensure sort order matches order of keys supplied
editorDataItems = editorDataItems.OrderBy(x => keys.IndexOf(x.Key));
}

return editorDataItems;
Expand Down

0 comments on commit 7572460

Please sign in to comment.