-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(cdk/drag-drop): added dropPoint to dropped event #22347
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
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Ah yes, this has been confusing me. It would be nice if the drop position is decided based on the mouse pointer position. Is there an easy way to do this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@crisbeto Adding
Should this be |
It's hard to tell why it's breaking from the error. Does the app try to type an event using our interface? I don't think that this includes any changes that would be considered breaking. |
@crisbeto It breaks in cases like this: function createDragDropEvent(...): CdkDragDrop<string[], string[]> {
...
return {
container,
previousContainer,
currentIndex,
previousIndex,
item,
isPointerOverContainer,
distance,
};
} CdkDragDrop<string[], string[]> is missing 'dropPoint' so people will start seeing errors |
I don't think that's something we cover with our breaking change policy. For g3 it could be patched as |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I need to be able to determine the exact point where the mouse pointer was when the Item was dropped. This is not possible to calculate from the distance, because it depends on the position where the item was grabbed at drag start.
CdkDragDrop.item.getFreeDragPosition(); does also not work because it gives the position of the element top/left corner at drag start.