Skip to content

Commit 42f7ff3

Browse files
committed
feat: sort inactive chidlren at the bottom
1 parent 54b2be8 commit 42f7ff3

File tree

1 file changed

+5
-0
lines changed
  • packages/app-frontend/src/features/components/composable

1 file changed

+5
-0
lines changed

packages/app-frontend/src/features/components/composable/components.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ export async function loadComponent (id: ComponentTreeNode['id']) {
326326

327327
export function sortChildren (children: ComponentTreeNode[]) {
328328
return children.slice().sort((a, b) => {
329+
if (a.inactive && !b.inactive) {
330+
return 1
331+
} else if (!a.inactive && b.inactive) {
332+
return -1
333+
}
329334
const order = compareIndexLists(a.domOrder ?? [], b.domOrder ?? [])
330335
if (order === 0) {
331336
return a.id.localeCompare(b.id)

0 commit comments

Comments
 (0)