angular / angular/components

bug(MatDialogRef): updatePosition is not consistent for previously dragged dialog

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

説明

#### Reproduction

The `updatePosition()` doesn't seem to be consistent if the dialog is previously dragged.

It is my understanding, according to the documentation that `updatePosition({bottom: '5px', right: '0px'})` will place my dialog at the bottom right of its container (`cdk-overlay-container` if I'm right ?).

[Here is a forked StackBlitz from the documentation](https://stackblitz.com/edit/angular-hc5lgp?file=app%2Fdialog-overview-example.ts) with, of course, minor changes.

With it, please:
1. open the dialog
2. click on the "minimize" button next to the title (dialog goes to the bottom right of the screen as expected : 👍 nice).
3. click on the "maximize" button next to the title to get the dialog back to it initial place. Also 👍 nice.

so far so good !

4. drag the dialog downwards (or in any direction you want) generously and minimize it again.


#### Expected Behavior

The dialog should be at the exact same place as it was after step 2.

#### Actual Behavior

The dialog's position has been updated, but with an additionnal translation.
(That additionnal translation seems to be of the same length as the previous drag.)

Worst : you can get the dialog outside of the screen if your drag was too generous, preventing you from dragging it back on visual.

#### Environment

- Angular: 9.1.7 (but discovered and reproduced in 7.3.4)
- CDK/Material: 9.2.4 (but discovered and reproduced in 6.4.1)
- Chrome 83.0.4103.61 64bits
- Windows 10 64bits

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

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

調査の方向性

まず、リンク先の StackBlitz で動作を再現し、ダイアログをドラッグした後の MatDialogRef.updatePosition() に注目します。ドラッグと右下の位置がどのように関係するかを追跡し、ドラッグ後に最小化すると、ダイアログがドラッグ前と同じ位置に配置されることを確認します。

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

評価

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

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

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