OutlinePanel: Display object list in A-Z order (#115)

This commit is contained in:
Don McCurdy 2022-03-31 08:30:31 -07:00 committed by GitHub
parent 2bf081478f
commit f1a1f48c0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,15 +19,17 @@ const ObjectsList: React.FC<{
return (
<>
{objectsEntries.map(([objectPath, object]) => {
return (
<ObjectItem
depth={depth}
key={'objectPath(' + objectPath + ')'}
sheetObject={object}
/>
)
})}
{objectsEntries
.sort(([pathA], [pathB]) => (pathA > pathB ? 1 : -1))
.map(([objectPath, object]) => {
return (
<ObjectItem
depth={depth}
key={'objectPath(' + objectPath + ')'}
sheetObject={object}
/>
)
})}
</>
)
}, [sheet, depth])