Skip to content
Snippets Groups Projects
Commit 67bb5e18 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'z-index-bug' into 'main'

Change zIndex of dragged item to be the biggest

See merge request !10
parents 802e1247 cfa0806f
No related branches found
No related tags found
1 merge request!10Change zIndex of dragged item to be the biggest
Pipeline #138856 failed
......@@ -31,10 +31,13 @@ export default {
mouseX: event.clientX - rect.x - rect.width / (2 * this.w), // relative to center of the top left square
mouseY: event.clientY - rect.y - rect.height / (2 * this.h),
};
// Now the element is on top of everything else inside the grid (not on top of other grids though)
this.zIndex = 999999;
},
handleDragEnd() {
this.offsetX = 0;
this.offsetY = 0;
this.zIndex = "auto";
},
handleDragMove(event) {
this.offsetX += event.dx;
......@@ -108,6 +111,7 @@ export default {
dataTransfer: {},
offsetX: 0,
offsetY: 0,
zIndex: "auto",
};
},
};
......@@ -123,5 +127,6 @@ export default {
calc(1px * v-bind(offsetX)),
calc(1px * v-bind(offsetY))
);
z-index: v-bind(zIndex);
}
</style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment