DragService: allow a custom cursor for component drags

Aperta Adatta ai principianti
#455 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia dai percorsi integrati di trascinamento dei componenti in src/services/drag/DragService.ts e packages/graph/src/services/drag/DragService.ts, dove secondo l’issue viene fornito direttamente grabbing. Confronta questi percorsi con l’opzione esistente startDrag({…}, {cursor}). Il lavoro è completato quando i trascinamenti standard dei componenti possono scegliere un cursore attivo, usano grabbing per impostazione predefinita e tornano alla selezione automatica del cursore al termine o in caso di annullamento.

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

Descrizione

Use case

A canvas component represents a draggable handle for an orthogonal edge segment. A vertical segment moves horizontally, so it should show ew-resize throughout the gesture. The corresponding cursor for a horizontal segment is ns-resize.

Reproduction

  1. Use a custom GraphComponent with isDraggable() returning true, a hover cursor of ew-resize, and the standard handleDragStart / handleDrag callbacks.
  2. Hover the handle, press it, then move far enough for the component drag to begin.
  3. The cursor switches to grabbing for the active drag.

Expected behavior

Allow the component that initiates a standard component drag to opt into its own active drag cursor. Keep grabbing as the default. The active cursor may differ from the hover cursor. After the drag ends or is cancelled, return to automatic cursor selection.

startDrag({…}, {cursor}) already supports a cursor for custom operations. The built-in component path supplies "grabbing" directly in main and v2.

Lingua principale
TypeScript
Stelle
145
Fork
12
Merge medio
1g 14h
PR unite (30g)
43

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di gravity-ui/graph

Tutte le issue di gravity-ui/graph

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.