angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

Question: How to make dragged-item appear overtop all other items?

Open harvanchik opened this issue 2 years ago • 6 comments

I tried setting the z-index, but the dragged-item is underneath other items in the grid.

image

harvanchik avatar Sep 02 '21 19:09 harvanchik

Anyone know a solution to this?

harvanchik avatar Oct 22 '21 19:10 harvanchik

I believe the default behavior is for the dragged item to appear above the others, but you might want to try playing with the multilayer functionality: https://tiberiuzuld.github.io/angular-gridster2/multiLayer

bpugh avatar Oct 22 '21 20:10 bpugh

I believe the default behavior is for the dragged item to appear above the others, but you might want to try playing with the multilayer functionality: https://tiberiuzuld.github.io/angular-gridster2/multiLayer

No, this is not the case. You can see in this demo. Turn off Push Items and drag the first item over another. You can see that the blue trash icon is not covered up; however, if you drag another item over the first one, it does cover the blue trash icon.

harvanchik avatar Oct 22 '21 20:10 harvanchik

@harvanchik Did you find a solution for this?

verygreenboi avatar Apr 25 '22 09:04 verygreenboi

@harvanchik Did you find a solution for this?

Unfortunately, I did not.

harvanchik avatar Apr 25 '22 16:04 harvanchik

You can work around this with the handlers in draggable.

draggable: {
  enabled: true,
  start: (_, gridsterItemComponent) => {
    gridsterItemComponent.el.style.zIndex = '2';
  },
  stop: (_, gridsterItemComponent) => {
    gridsterItemComponent.el.style.zIndex = '1';
  },
},

ovska avatar Jun 21 '22 08:06 ovska