Draggable JS, How to fix mirror z-index ?

diewland
diewland
Nov 6 · 1 min read

What is Draggable ? Try this..

This is how can I implement.

const containers = document.querySelectorAll('.container');
swappable = new Draggable.Swappable(containers, {
mirror: {
constrainDimensions: true,
},
});

Closely to complete. But when drag object to somewhere z-index looks weird. You can fix by css very fast.

.draggable-mirror { z-index: 99; }

And happy dragging \o/

Reference: https://github.com/Shopify/draggable/issues/185

diewland

Written by

diewland

เติบโตขึ้นเป็นลุงที่ใจดี 😉

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade