angular / angular/components

Drag Drop: disable shifting on target droplist and enable replacing

未关闭
#16,153 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area: cdk/drag-drop feature P4
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### Feature Description

Looking at multiple droplists enable to drag one item from droplist 1 to droplist 2. After dropping item 1 on item 2, switch position instead of shifting all items to the next position.

#### Use Case

What we now did is just added this to every droplist:
` (cdkDropListDropped)="drop($event, indexRow)"`

In this 'drop' function we made 2 situations, either `transferArrayItem()` or `moveItemInArray()`

This just moves the items inside the droplist or moves them from one droplist to another. This all works. The downside is though, while you are dragging an item from droplist 1 to droplist 2, you see all the items in droplist 2 shifting a position to the right (When horizontal orientated). While our code says in the background to just switch places.
After the code is done, the shifted items all go back to their original places.

贡献指南

打开贡献指南

调研方向

issue 中没有提到文件或测试。首先跟踪这里描述的 Angular CDK 拖放列表行为和 cdkDropListDropped 回调;完成的标准是,列表间拖放会直观地替换目标项,而不会移动相邻项。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。