-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(cdk/drag-drop): adding method to set drag position #24744
feat(cdk/drag-drop): adding method to set drag position #24744
Conversation
Adds method `setFreeDragPosition` in Cdk `DragDrop` directive to set position in pixel on a drop container. Fixes angular#18530
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.
We already have an API to do this through the cdkDragFreeDragPosition
input.
Thanks @crisbeto for your feedback. Here is a sample of what we are developing on our project: https://stackblitz.com/edit/angular-ivy-xxffrj?file=src/app/app.component.ts Keep an eye on code:
So basically, it is a simple slider where a left marker has to control also the position of other drag elements (center marker in sample case). So we have noted that is it more convenient and clean to have also a To be honest I guess that could be more useful to deprecate What do you think? |
ok, that makes sense. I'd be fine with leaving both in since one covers the case where the position is set declaratively while the other allows for it to be done programmatically. In our to get the CI to pass, you have to run these two commands and commit the result:
Also while we're at it, the type of |
…getFreeDragPosition Corrects some inaccurate types on a couple of freeDragPosition methods of the `DragDrop` directive.
…getFreeDragPosition Corrects some inaccurate types on a couple of freeDragPosition methods of the `DragDrop` directive.
…meriturva/components into cdkdrag-add-setFreeDragPosition
Hi @crisbeto I made a few improvements as advised in your comment, but I don't know why About Regarding commit messages, I don't know if I have to squash all to a single one. If yes do I have to indicate both changes (new method and typing change) ? So thanks. |
We usually squash the commits automatically before they're merged into master, but each individual commit still has to pass the formatting check. My guess is that the merge commit is causing it to fail. |
Hi @crisbeto now I really need your help.
Here final commit message that, for me, seems correct:
I have also tried to disable hooks using env variables: I have tried so many times on Ubutun and also WSL2, with Git 2.35.1 and node 16.x but no way to conclude rebase. Could you help me to conclude this pr? Thanks again. |
I'm not sure why it could be happening, my guess is that it's due to the merge commit that is still in the branch. An alternative could be to create a new branch, cherry-pick the commit into it and submit a new PR. |
Close it in favor of a new one. |
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. |
Adds method
setFreeDragPosition
in CdkDragDrop
directive to setposition in pixel on a drop container.
Fixes #18530