angular / angular/components

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

オープン
#29,867 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: cdk/drag-drop needs: discussion
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/main.ts にあるリンク先の StackBlitz 再現を確認することから始め、cdkDragBoundary が存在する場合の結果と、CdkDragMove の pointerPosition に関するドキュメント記載の動作を比較します。イベントを生成する CDK のドラッグ処理を追跡し、その後、ドラッグされた要素が境界内に制限されている間も、pointerPosition が境界の外側にあるカーソルの画面上の位置を維持することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。