angular / angular/components

bug(drag-drop): changing the disable state dynamically doesn't work

Aperta
#19,065 10 commenti 1 reazione 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

For some reason, in Stackblitz it works: https://stackblitz.com/edit/angular-ghqzcr
But in a new project, the bug also reproduces: https://github.com/doronsever/drag-drop-bug
I copied everything from stackblitz to my project and still doesn't work.

I need the initiate state of the drag and drop to be disabled and only when clicking on the mouse down to enable it.
The reason for that is that I have also a resize option and if the drag and drop is enabled, when resizing it is also dragging the element.

So in my real app, I'm starting with the drag and drop disabled, and on a mousedown event, I check if the mouse is not touching the resize button and only then enabling the drag and drop.
Up until Angular 8, everything worked fine but now that we are trying to upgrade to Angular 9 (and also material to 9, this behavior stopped working).


#### Expected Behavior

When setting the flag to false, enable the dragging even if the mouse is down.

#### Actual Behavior

drag and drop doesn't work

#### Environment

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia confrontando la riproduzione StackBlitz con la riproduzione new-project collegata, concentrandoti sulla configurazione drag-and-drop di Angular CDK e sul flag disabled dinamico. Riproduci il comportamento di Angular 9.1.1/Material 9.2.0 in Chrome, quindi verifica che il trascinamento possa essere abilitato durante mousedown, mentre il ridimensionamento non avvii un trascinamento.

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

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.