angular / angular/components

feat(drag-drop): cdkConnectedTo finds all drop lists with the same ID, instead of only one

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

説明

#### Feature Description

`CdkDropList` has `id` and `cdkConnectedTo` input properties to allow specifying an id or array of ids for which the drop lists should be connected.

The `id` input property "needs" to be unique, or better put is "assumed" to be unique - meaning when searching through drop lists to connect to by id, only the first match is returned.

Can the "need" for unique ids be removed and change the connected drop list logic to return **all** drop lists with a matching id?

From the user's perspective:

- If I want a drop list to inherently be standalone, provide a unique id.
- If I want a drop list to inherently be connected to others, provide a shared id.

#### Use Case

Connecting drop lists created dynamically, possibly defined in separate template files and with arbitrary DOM relation, **without** the overhead of having to maintain a separate list of all drop lists that should be connected, and making sure this list is properly updated and propagated to each drop list via change detection.

Instead a statically defined (or could be dynamic) id for the `id` and `cdkConnectedTo` inputs will automatically connect all the drop lists without any further coordination from the user.

Similar to what @sroettering mentioned [here](https://github.com/angular/components/pull/13754#issuecomment-436694651), but I don't think a new input property is necessary.

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

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

調査の方向性

まず CdkDropList の実装とそのテストを特定し、次に id と cdkConnectedTo が接続されたドロップリストをどのように解決するかを追跡します。共有された id が一致するすべてのリストを解決するように動作を更新し、一意の id は単独のままで、共有された id は一致するすべてのリストを接続することを確認します。

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

評価

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

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

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