bug(drag-drop): Draggable elements inside SVG DropList not spawning underneath cursor
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### Reproduction
Use StackBlitz to reproduce your issue:
- Components: https://stackblitz.com/fork/components-issue
- Harnesses: https://stackblitz.com/fork/harness-issue
Steps to reproduce:
1. Go to either https://stackblitz.com/edit/angular-droplist-with-previewcontainer?file=src/app/app.component.html
or https://stackblitz.com/edit/angular-droplist-without-previewcontainer?file=src/app/app.component.html
2. Drag the "Test" element to the other droplist
3. Release LMB
#### Expected Behavior
In both cases I would expect the "Preview" element to spawn next to the mouse cursor and to be dropped on the droplist under the cursor.
#### Actual Behavior
In the first example "with-previewcontainer" I use the `cdkPreviewContainer` attribute to spawn the "Preview" element inside the parent svg, in that case it spawns correctly, but the drop is offset. By moving the mouse cursor somewhere towards the bottom right of the page, the "Test" element can be seen moving to the other droplist.
In the second example "without-previewcontainer" the `cdkPreviewContainer` is omitted and the "Preview" element spawn at the top left of the page. The offset from the top left seems to correlate with the offset of the mouse cursor inside the droplist. Moving the mosue cursor far enough down and to the right will again make the "Test" element move to the other droplist.
The behaviour in Firefox seems to be slightly different.
#### Environment
- Angular: 12.2.6
- CDK/Material: 12.2.5
- Browser(s): Edge 93.0.961.52, Chrome 93.0.4577.82, Brave 1.29.81, Firefox 92.0.1
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
コントリビューションガイド
調査の方向性
まず、リンクされている2つの StackBlitz の再現例を実行し、src/app/app.component.html を調べて、cdkPreviewContainer のケースと omitted-container のケースを比較します。両方の SVG 例で、プレビューがカーソルの横に表示され、要素がカーソルの下のドロップリストにドロップされ、説明されているブラウザーの動作も含めて確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100