Skip to content

Commit 1f7b179

Browse files
committed
fix(components): sort by position
1 parent b4c0a1b commit 1f7b179

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/app-backend-vue3/src/components/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class ComponentWalker {
165165
// record screen position to ensure correct ordering
166166
if ((!list || list.length > 1) && !instance._inactive) {
167167
const rect = getInstanceOrVnodeRect(instance)
168-
treeNode.positionTop = rect ? rect.positionTop : Infinity
168+
treeNode.positionTop = rect ? rect.top : Infinity
169169
}
170170

171171
if (instance.suspense) {

packages/app-frontend/src/features/components/ComponentTreeNode.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export default {
3131
const componentHasKey = computed(() => (props.instance.renderKey === 0 || !!props.instance.renderKey) && props.instance.renderKey !== UNDEFINED)
3232
3333
const sortedChildren = computed(() => props.instance.children ? props.instance.children.slice().sort((a, b) => {
34-
return a.top === b.top
34+
return a.positionTop === b.positionTop
3535
? a.id - b.id
36-
: a.top - b.top
36+
: a.positionTop - b.positionTop
3737
}) : [])
3838
3939
const {

0 commit comments

Comments
 (0)