fix(core): cast zIndex to number in node wrapper

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-24 20:07:13 +01:00
committed by Braks
parent 17c28a7b6d
commit 79e7f3ccdb
@@ -84,6 +84,8 @@ const getStyle = computed(() => {
return styles
})
const zIndex = computed(() => Number(node.zIndex ?? getStyle.value.zIndex ?? 0))
onUpdateNodeInternals((updateIds) => {
if (updateIds.includes(id)) {
updateInternals()
@@ -122,16 +124,13 @@ watch(
() => node.dimensions.width,
() => parentNode?.dimensions.height,
() => parentNode?.dimensions.width,
() => node.zIndex,
zIndex,
],
([newX, newY, parentX, parentY, parentZ]) => {
let zIndex = isNumber(node.zIndex) ? node.zIndex : 0
zIndex = isNumber(getStyle.value.zIndex) ? getStyle.value.zIndex : zIndex
const xyzPos = {
x: newX,
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)) {
@@ -270,7 +269,7 @@ export default {
getClass,
]"
:style="{
zIndex: node.computedPosition.z ?? 0,
zIndex: node.computedPosition.z ?? zIndex,
transform: `translate(${node.computedPosition.x}px,${node.computedPosition.y}px)`,
pointerEvents: selectable || draggable ? 'all' : 'none',
...getStyle,