Skip to content
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

help(COMPONENT): cdkDragConstrainPosition works strange #25046

Closed
v1nger125 opened this issue Jun 9, 2022 · 1 comment · Fixed by #25061
Closed

help(COMPONENT): cdkDragConstrainPosition works strange #25046

v1nger125 opened this issue Jun 9, 2022 · 1 comment · Fixed by #25061
Assignees
Labels
area: cdk/drag-drop P2 The issue is important to a large percentage of users, with a workaround

Comments

@v1nger125
Copy link

v1nger125 commented Jun 9, 2022

What are you trying to do?

i'm trying to create some grid with cdkDragConstrainPosition but some clicks cause random movements close to the grid nodes
as an example i create i simple one of your demo with constant values of cdkDragConstrainPosition but it still continue random movement on each drag-drop, does i miss something? in such case i supposed it should stay static
https://stackblitz.com/edit/angular-iwidmo-1kbix8?file=src/app/cdk-drag-drop-free-drag-position-example.html

What troubleshooting steps have you tried?

above

Reproduction

Steps to reproduce:

  1. setup cdkDragConstrainPosition with static values
  2. try to drag-drop it

https://stackblitz.com/edit/angular-iwidmo-1kbix8?file=src/app/cdk-drag-drop-free-drag-position-example.html

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):
@v1nger125 v1nger125 added needs triage This issue needs to be triaged by the team troubleshooting This issue is not reporting an issue, but just asking for help labels Jun 9, 2022
@crisbeto crisbeto self-assigned this Jun 10, 2022
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround area: cdk/drag-drop and removed troubleshooting This issue is not reporting an issue, but just asking for help needs triage This issue needs to be triaged by the team labels Jun 10, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 11, 2022
Fixes that the `constrainPosition` input wasn't constraining the position as described in the docs. This may have worked at some point, but it's definitely broken now. Our tests didn't catch it, because they were looking at the `transform` which was wrong, instead of the position the element ended up at.

Fixes angular#25046.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jun 11, 2022
Fixes that the `constrainPosition` input wasn't constraining the position as described in the docs. This may have worked at some point, but it's definitely broken now. Our tests didn't catch it, because they were looking at the `transform` which was wrong, instead of the position the element ended up at.

Fixes angular#25046.
crisbeto added a commit that referenced this issue Jun 12, 2022
Fixes that the `constrainPosition` input wasn't constraining the position as described in the docs. This may have worked at some point, but it's definitely broken now. Our tests didn't catch it, because they were looking at the `transform` which was wrong, instead of the position the element ended up at.

Fixes #25046.

(cherry picked from commit 2c956c0)
crisbeto added a commit that referenced this issue Jun 12, 2022
Fixes that the `constrainPosition` input wasn't constraining the position as described in the docs. This may have worked at some point, but it's definitely broken now. Our tests didn't catch it, because they were looking at the `transform` which was wrong, instead of the position the element ended up at.

Fixes #25046.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: cdk/drag-drop P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants