-
Notifications
You must be signed in to change notification settings - Fork 6.8k
cdkDrag: with cdkDropList -> wrong Cursor when dragging #20246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is this reporting an issue with the example or it's CSS? or is this reporting an issue with the cdkDrag directive? |
I think its a issue with the cdkDrag directive. Before version 7.2.x it works fine |
The way we detect whether the user's pointer is over a drop list is through It could be worked around by using |
While implementing custom drag and drop directive (before Angular CDK) i was able to resolve this by hiding/showing dragImage i in a single atomic cycle while mouse moves
Did not experience flickering/drawing problems so far (although it was tested on not big drag images/preview objects) |
@marijanlekic can you provide a complete example with html? EG what drag event are you listening to? What is the point of accessing the curHoveredElement? Also @crisbeto you mention in a couple places, #15090 (comment), that this can be worked around with current APIs. An example (stackblitz would be awesome) of working around this with current APIs would go a long way. |
@newmanw what I was referring to in that comment is that you can add a class to the
|
I wrote my own drag and drop functionality so i dont use CDK drag events. By using "pointer-events:none" we are not not able to control cursor in the way that we want to (wrong cursor/getting cursor from the element that is below dragging preview element), and also, when we use pointerEvents: none, the element that is below dragging preview element, will get events such as "mouseenter", "mouseleave", "mousemove", etc. So basically i resolved this by not setting "pointer-events:none". Instead, i set cursor to anything that i want to and i get element that is below dragging image by hiding preview element and showing it.
For my needs, i did not face any rendering/other problems... |
I have fixed it with this custom directive. Just use it for the same element where the
|
For myself, I added the following style override to re-enable the custom cursor while dragging.
Live Example: https://stackblitz.com/edit/angular-g2yu5w?file=src/app/cdk-drag-drop-custom-placeholder-example.css |
@joelkesler how are you able to drop the element now? pointer-events: auto; But im not able to drop my element if the style is not |
I'm facing the same issue. The solution presented by @joelkesler works but there's some latency to enable to drop in the target drop list. After trying @ohryk-intellias sugestion it works like a charm! Thanks for that! |
For anyone that cannot apply this solution directly because of |
Hi, the
|
Hi all,


Here is a little sample.
https://stackblitz.com/angular/yvmnrxexppp?file=app%2Fcdk-drag-drop-connected-sorting-example.html
Since version 7.2.x (I noticed) there is the problem that the cursor (set in CSS) adapts to the underlying object during the dragging process.
If the cursor is changed to "move" and I use e.g. move an "input" (drag) then the cursor changes from move to input.
This phenomenon only occurs with cdkDropList, not when the cdkDrag property is only set for a single object.
The CSS:
The HTML:
The text was updated successfully, but these errors were encountered: