feat(drag-drop): cdkConnectedTo finds all drop lists with the same ID, instead of only one
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 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, but I don't think a new input property is necessary.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 CdkDropList 的实现及其测试,然后跟踪 id 和 cdkConnectedTo 如何解析已连接的放置列表。更新行为,使共享的 id 能解析所有匹配的列表,并验证唯一的 id 仍保持独立,而共享的 id 会连接每个匹配的列表。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, typescript
- 领域
- frontend
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100