angular / angular/components

Drag/drop placeholder doesn't work if placeholder is smaller than draggable list elements

Open
#16,259 4 comments 1 reaction 0 assignees View on GitHub
area: cdk/drag-drop P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
The placeholder should be placed correctly, regardless of if the placeholder is the same size as the list elements or a different size.

#### What is the current behavior?
The placeholder is in the wrong spot in the list while dragging an element, but only if the placeholder is smaller (less height for a vertical list, or less width for a horizontal list).

#### What are the steps to reproduce?
Stackblitz: https://angular-ztyby3.stackblitz.io
Drag the top element down. Observe that the placeholder moves to the top. Then, move it back upwards, and observe that the placeholder moves to the bottom. This is the opposite of how the placeholder should work.

#### What is the use-case or motivation for changing an existing behavior?
It does not work as expected.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/*: 8.0.0
OS: Win10
TS: 3.4.5

#### Is there anything else we should know?

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and reproduce the drag/drop behavior using the reported Angular 8 setup. Then trace the Angular drag-and-drop implementation that positions the placeholder for differently sized list elements. Done means the placeholder remains in the correct position when dragging an element down and back up, including when it is smaller than the list elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.