Change how z-index is applied to the dragged element
This commit is contained in:
parent
2f3a7018ae
commit
d6f33b2191
|
@ -150,7 +150,7 @@
|
|||
display: grid;
|
||||
gap: 0;
|
||||
grid-template-rows: repeat(var(--rows), calc(var(--row-size) * 1px));
|
||||
grid-template-columns: repeat(var(--cols), 1fr);
|
||||
grid-template-columns: repeat(var(--cols), calc(var(--col-size) * 1px));
|
||||
position: relative;
|
||||
}
|
||||
.underlay {
|
||||
|
@ -185,6 +185,9 @@
|
|||
outline: 2px solid var(--spectrum-global-color-static-blue-200);
|
||||
pointer-events: none !important;
|
||||
}
|
||||
:global(.grid.highlight > .component.dragging) {
|
||||
z-index: 999 !important;
|
||||
}
|
||||
|
||||
/* Ensure all top level children have grid styles applied */
|
||||
.grid :global(> .component) {
|
||||
|
|
|
@ -29,20 +29,11 @@
|
|||
|
||||
// Set ephemeral styles
|
||||
$: instance = componentStore.actions.getComponentInstance(id)
|
||||
$: $instance?.setEphemeralStyles(enrichComponentStyles($styles))
|
||||
$: $instance?.setEphemeralStyles($styles)
|
||||
|
||||
// Sugar for a combination of both min and max
|
||||
const minMax = (value, min, max) => Math.min(max, Math.max(min, value))
|
||||
|
||||
const enrichComponentStyles = styles => {
|
||||
let clone = { ...styles }
|
||||
if (styles) {
|
||||
clone["z-index"] = 999
|
||||
clone["pointer-events"] = "none"
|
||||
}
|
||||
return clone
|
||||
}
|
||||
|
||||
const processEvent = Utils.domDebounce((mouseX, mouseY) => {
|
||||
if (!dragInfo?.grid) {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue