angular-gridster2
angular-gridster2 copied to clipboard
Question: How to make dragged-item appear overtop all other items?
I tried setting the z-index, but the dragged-item is underneath other items in the grid.
Anyone know a solution to this?
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
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 Did you find a solution for this?
@harvanchik Did you find a solution for this?
Unfortunately, I did not.
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';
},
},