react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

Different default position in UI if ordering is different

Open WayneTvT opened this issue 3 years ago • 0 comments

This the correct position: 螢幕截圖 2022-08-14 下午1 03 02

If I remove point 1 and add it again it will be come this: 螢幕截圖 2022-08-14 下午1 03 08

Otherwise, If I remove point 2 and add again will resume normal. Seems the ordering need to be point 1 first and point 2 after.

I added an Image for the background so the container position is "absolute", I tried change it to "relative" but same result.

<div
	style={{
		position: "absolute",
		height: height+'px',
		width: width+'px',
		top: 0,
		left: 0
	}}
>
{
	devices.map((d, i) => {
		return (
			<Draggable
			key={`devices-${d.r_id}`}
			axis="x"
			defaultPosition={{x: d.r_x, y: d.r_y}}
			scale={1}
			bounds="parent">
				<div className="location-fade-in-out">
					{d.r_id}
				</div>
			</Draggable>
			)
	})
}
</div>

WayneTvT avatar Aug 14 '22 05:08 WayneTvT