Strange "Ghost" Silhouette of Draggable Element When Using Non-integer (i.e., numbers with decimals)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react
- Ambito
- frontend
Direzione di ricerca
Start with the Draggable component's controlled position handling and reproduce the provided example using decimal x and y values. Trace the drag-start behavior after handleDragStop sets the position, then verify that dragging no longer shows a silhouette when the position contains decimals.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
If you set the state of a Draggable element's position to a non-integer (i.e., a number with decimals, like 123.4), you will get a strange silhouette of the element when dragging it. Consider this example:
import { useState } from 'react';
interface PositionModel {
x: number;
y: number;
}
const MyComponent = () => {
const [pos, setPos] = useState({ x: 0, y: 0 } as PositionModel);
const handleDragStop = (_e: DraggableEvent, position: DraggableData) => {
setPos({ x: 456.2, y: 229.8 });
};
return (
<Draggable
position={pos}
onStop={handleDragStop}
>
<div>I am an element</div>
</Draggable>
);
};
After the handleDragStop function is triggered and you go to drag the component again, you'll see something similar to this:
- Lingua principale
- JavaScript
- Stelle
- 9.3k
- Fork
- 1k
- Merge medio
- 3g 8h
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di react-grid-layout/react-draggable
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
react-grid-layout/react-draggable#784 · 4 commenti · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
react-grid-layout/react-draggable#782 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
react-grid-layout/react-draggable#781 · 1 commento · 2 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
react-grid-layout/react-draggable#780 · 8 commenti ·
Tutte le issue di react-grid-layout/react-draggable
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Daemon passes --experimental-wasm-jspi unconditionally on Node >= 24; Node 26 rejects the flag Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Automattic/studio#4908 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
sugarlabs/musicblocks#8847 ·