angular / angular/components

bug(drag-drop): cdkDropListSortingDisabled interacts badly with connected lists

Aperta
#23,766 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: cdk/drag-drop P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Reproduction

This is a fork of the "disable sorting" example from the docs.

https://stackblitz.com/edit/angular-lcgpvd?file=src/app/cdk-drag-drop-disabled-sorting-example.ts

Steps to reproduce:
1. Open example
2. Drag an item from one list to another


#### Expected Behavior

One of the following, internally-consistent behaviors:

* the receiving list provides some way of determining where the incoming item will be sorted
* the incoming item always goes before the first item
* the incoming item always goes after the last item

#### Actual Behavior

The incoming item gets a placeholder wherever the user drags it, but then can't be moved. The user can continue dragging back to the original list, so the placeholder goes back to the original position then drag over the target list again to put the placeholder in a new position -- but again, can't move the placeholder directly.

#### Environment

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

#### Comments

I'd like to see the first behavior implemented -- let me supply a sort-function that gets the dragged item's `data` (and maybe the index in its current container?) as an input and outputs the list index at which the placeholder should be inserted. Failing that, I'd at least like a property that lets me say that, since sorting is disabled, the placeholder should go at the "start" or "end".

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’esempio StackBlitz collegato in src/app/cdk-drag-drop-disabled-sorting-example.ts e riproduci il trascinamento tra liste connesse con l’ordinamento disabilitato. Poi traccia il comportamento di CDK drag-drop delle liste connesse che posiziona il segnaposto. Il lavoro è completato quando viene scelto e implementato un comportamento coerente della lista ricevente, con una copertura per la riproduzione segnalata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.