angular / angular/components

bug(drag-drop): Item not always restored to initial index when using cdkDropListSortingDisabled on connected lists

オープン
#26,360 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: cdk/drag-drop P3
主要言語
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

Dragging an item from its original drop list to another one then dragging it back to the original drop list isn't always restored to its initial index.

### Reproduction

StackBlitz: https://stackblitz.com/edit/angular-1ra8a1?file=src/app/cdk-drag-drop-disabled-sorting-example.html

Steps to reproduce:
1. Drag any item item from the top container to the bottom one (without dropping) and drag it back to the top container
2. Observer that the item gets re-added at its original index in the top container
3. Drag any item but the first from the bottom container to the top one (without dropping) and drag it back to the bottom container

### Expected Behavior

Item re-added to the bottom container at its original index.

### Actual Behavior

Item re-added to the bottom container at an index lower than its original.

### Environment

- Angular: 15.0.4
- CDK/Material: 15.0.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

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

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

調査の方向性

リンクされた StackBlitz での再現から始め、特に src/app/cdk-drag-drop-disabled-sorting-example.html を確認し、アイテムをドロップせずに接続されたリスト間で移動したときにインデックスが変化することを検証します。無効なソートに対する CDK drag-drop の処理を追跡し、アイテムが元のインデックスの元のリストに戻った時点で完了を確認します。

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

評価

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

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

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