angular / angular/components

CDKDragAndDrop: Collapse cdkDropList item contents on cdkDragStarted event

Offen
#18,179 4 Kommentare 8 Reaktionen 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

### (Marked as troubleshooting since I wasn't sure if there was a known solution for this case)
#### What are you trying to do?

Collapse/hide the contents of all items in a cdkDropList upon starting a drag event, leaving a condensed view of labels that is easier to sort.

#### What troubleshooting steps have you tried?

When starting the drag event, all items collapse except for the item currently being dragged, causing issues in the list placeholder when attempting to drop an item. Once the drop event is complete, the dropped item collapses and the list returns to normal.

#### Reproduction

StackBlitz: https://stackblitz.com/edit/components-issue-bt4kvt?file=app%2Fapp.component.ts

Steps to reproduce:
1. Set up a cdkDropList with items that contain a title and collapsible content panel.
2. Set the cdkDragStarted event for the list items to collapse all of the content panels.
3. Make sure all items in the list are expanded.
4. Begin dragging one of the items.

#### Environment

- Angular: 8.2.0
- CDK/Material: 8.2.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der verlinkten StackBlitz-Reproduktion und reproduziere das Verhalten rund um das cdkDragStarted-Ereignis auf einer cdkDropList. Untersuche, wie das gezogene Element und der Platzhalter der Liste dimensioniert werden, während die Inhalte der anderen Elemente zusammenfallen. Die Aufgabe ist erledigt, wenn das Ziehen mit zusammengeklappten Elementinhalten keine Probleme mehr mit dem Platzhalter verursacht und die Liste nach dem Ablegen in ihren normalen Zustand zurückkehrt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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