fix(core): cast zIndex to number in node wrapper
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -84,6 +84,8 @@ const getStyle = computed(() => {
|
|||||||
return styles
|
return styles
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const zIndex = computed(() => Number(node.zIndex ?? getStyle.value.zIndex ?? 0))
|
||||||
|
|
||||||
onUpdateNodeInternals((updateIds) => {
|
onUpdateNodeInternals((updateIds) => {
|
||||||
if (updateIds.includes(id)) {
|
if (updateIds.includes(id)) {
|
||||||
updateInternals()
|
updateInternals()
|
||||||
@@ -122,16 +124,13 @@ watch(
|
|||||||
() => node.dimensions.width,
|
() => node.dimensions.width,
|
||||||
() => parentNode?.dimensions.height,
|
() => parentNode?.dimensions.height,
|
||||||
() => parentNode?.dimensions.width,
|
() => parentNode?.dimensions.width,
|
||||||
() => node.zIndex,
|
zIndex,
|
||||||
],
|
],
|
||||||
([newX, newY, parentX, parentY, parentZ]) => {
|
([newX, newY, parentX, parentY, parentZ]) => {
|
||||||
let zIndex = isNumber(node.zIndex) ? node.zIndex : 0
|
|
||||||
zIndex = isNumber(getStyle.value.zIndex) ? getStyle.value.zIndex : zIndex
|
|
||||||
|
|
||||||
const xyzPos = {
|
const xyzPos = {
|
||||||
x: newX,
|
x: newX,
|
||||||
y: newY,
|
y: newY,
|
||||||
z: (zIndex || 0) + (elevateNodesOnSelect ? (node.selected ? 1000 : 0) : 0),
|
z: zIndex.value + (elevateNodesOnSelect ? (node.selected ? 1000 : 0) : 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNumber(parentX) && isNumber(parentY)) {
|
if (isNumber(parentX) && isNumber(parentY)) {
|
||||||
@@ -270,7 +269,7 @@ export default {
|
|||||||
getClass,
|
getClass,
|
||||||
]"
|
]"
|
||||||
:style="{
|
:style="{
|
||||||
zIndex: node.computedPosition.z ?? 0,
|
zIndex: node.computedPosition.z ?? zIndex,
|
||||||
transform: `translate(${node.computedPosition.x}px,${node.computedPosition.y}px)`,
|
transform: `translate(${node.computedPosition.x}px,${node.computedPosition.y}px)`,
|
||||||
pointerEvents: selectable || draggable ? 'all' : 'none',
|
pointerEvents: selectable || draggable ? 'all' : 'none',
|
||||||
...getStyle,
|
...getStyle,
|
||||||
|
|||||||
Reference in New Issue
Block a user