Skip to content

bug(cdkDrag): "pointerPosition" property of the "CdkDragMove" event is not correct with "cdkDragBoundary" #29867

Open
@clem4net

Description

@clem4net

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Context
According to the official documentation, the property "pointerPosition" of the "CdkDragMove" event is : "Position of the user's pointer on the page."
See : https://material.angular.io/cdk/drag-drop/api#CdkDragMove

Problem
If I use the "cdkDragBoundary" property, the property "pointerPosition" returns cursor position only between boundaries.

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-knrvcz?file=src%2Fmain.ts
Steps to reproduce:

  1. Move the red block until the cursor moves out of the blue block
  2. At the bottom of the blue box, you will see that the cursor position is stuck to the boundaries of the blue box.

Expected Behavior

I expect to have the current position of the cursor on screen, wherever it is located.

Actual Behavior

The position displayed of the cursor is limited to the limits of the blue block

Environment

  • Angular: 18.2.8
  • CDK/Material: 18.2.8
  • Browser(s): Chrome 129.0.6668.100
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions