angular / angular/components

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

Offen
#16,259 4 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
area: cdk/drag-drop P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### 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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der verknüpften StackBlitz-Reproduktion und reproduzieren Sie das Drag-and-Drop-Verhalten mit dem gemeldeten Angular-8-Setup. Verfolgen Sie anschließend die Angular-Drag-and-Drop-Implementierung, die den placeholder für Listenelemente unterschiedlicher Größe positioniert. Die Aufgabe ist abgeschlossen, wenn der placeholder beim Herunter- und anschließenden Wieder-nach-oben-Ziehen eines Elements an der richtigen Position bleibt, auch wenn es kleiner als die Listenelemente ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.