@@ -84,6 +84,8 @@ const getStyle = computed(() => {
84
84
return styles
85
85
})
86
86
87
+ const zIndex = computed (() => Number (node .zIndex ?? getStyle .value .zIndex ?? 0 ))
88
+
87
89
onUpdateNodeInternals ((updateIds ) => {
88
90
if (updateIds .includes (id )) {
89
91
updateInternals ()
@@ -122,16 +124,13 @@ watch(
122
124
() => node .dimensions .width ,
123
125
() => parentNode ?.dimensions .height ,
124
126
() => parentNode ?.dimensions .width ,
125
- () => node . zIndex ,
127
+ zIndex ,
126
128
],
127
129
([newX , newY , parentX , parentY , parentZ ]) => {
128
- let zIndex = isNumber (node .zIndex ) ? node .zIndex : 0
129
- zIndex = isNumber (getStyle .value .zIndex ) ? getStyle .value .zIndex : zIndex
130
-
131
130
const xyzPos = {
132
131
x: newX ,
133
132
y: newY ,
134
- z: ( zIndex || 0 ) + (elevateNodesOnSelect ? (node .selected ? 1000 : 0 ) : 0 ),
133
+ z: zIndex . value + (elevateNodesOnSelect ? (node .selected ? 1000 : 0 ) : 0 ),
135
134
}
136
135
137
136
if (isNumber (parentX ) && isNumber (parentY )) {
@@ -270,7 +269,7 @@ export default {
270
269
getClass,
271
270
]"
272
271
:style =" {
273
- zIndex: node.computedPosition.z ?? 0 ,
272
+ zIndex: node.computedPosition.z ?? zIndex ,
274
273
transform: `translate(${node.computedPosition.x}px,${node.computedPosition.y}px)`,
275
274
pointerEvents: selectable || draggable ? 'all' : 'none',
276
275
...getStyle,
0 commit comments