feat(drag-drop): cdkConnectedTo finds all drop lists with the same ID, instead of only one
- 主要言語
- 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