Proposal - overlapping cdkdrop elements respect z-index
cdkdrop with highest z-index takes priority when an element is dragged over multiple overlapping cdkdrop elements
_getSiblingContainerFromPosition uses this._positionCache.siblings.find so uses the first element found, regardless of z-index.
https://angular-92bnjh-jx5aoe.stackblitz.io
cdkdrop elements that overlap are being used for a particular design that uses triangles adjacent to vertically flipped triangles.
@angular/[email protected]
Overlapping cdkdrop elements are probably an unlikely use case!
I'm not sure how practical it would be to base the sorting on z-index since we'd have to make a lot of assumptions that may not be correct. It might make more sense to add an API where consumers can customize the sorting logic based on their use case.
Rather than using the CSS z-index, what if the drop zones had their own zIndex property?
I'm not sure the issue described here is necessarily down to zIndex. The problem is that, even though the elements are triangular, they're still inside a rectangular box which overlaps with the one after it.
Ah, I missed that part. Yeah, that doesn't seem like something the library could handle.
@jelbourn @crisbeto
Apart from the triangle-use case: Are there any options to work around the problem of one drop zone overlapping another? If I drag an item into the inner drop zone, the "cdkDropEntered" and "cdkDropExited" events are called for both zones every time the mouse moves.
This should be handled by https://github.com/angular/material2/pull/14257.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@jelbourn @crisbeto
Apart from the triangle-use case: Are there any options to work around the problem of one drop zone overlapping another? If I drag an item into the inner drop zone, the "cdkDropEntered" and "cdkDropExited" events are called for both zones every time the mouse moves.