angular / angular/components

Drag and drop, ability to hold element while drag

Offen
#15,795 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: cdk/drag-drop feature P5
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### Please describe the feature you would like to request.
Ability to pass boolean value for hold element while moving. it is something like `dragStartThreshold`, but during dragging. (it will block to change transform3d values till we change hold value e.g `cdkDragHold = false`)

#### What is the use-case or motivation for this proposal?
for example, if a user drags an element past near the center of the page, we need to magnetize the element with center for 20px area, then we pass new input e.g. `cdkDragHold = true` and by that we want to hold dragging element till we change this value. I think this might be useful for another many cases, bcs it's quite hard for user to moving element exactly pixel in pixel in some cases, but we can help to do this programmatically.
#### Is there anything else we should know?
It a bit similar to `dragStartThreshold` from `DragRefConfig`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das vorhandene Verhalten von DragRefConfig und dragStartThreshold zu lesen, und verfolge anschließend, wie cdkDrag während des Ziehens die transform3d-Werte aktualisiert. Lege fest, wie eine Hold-Eingabe mit dem angeforderten magnetisierten 20px großen mittleren Bereich interagieren würde, und füge Testabdeckung hinzu, die zeigt, dass die Bewegung pausiert und fortgesetzt wird, wenn sich der Wert ändert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

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