components icon indicating copy to clipboard operation
components copied to clipboard

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

Open clem4net opened this issue 1 year ago • 0 comments
trafficstars

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

clem4net avatar Oct 11 '24 15:10 clem4net