react-dnd / react-dnd-html5-backend

HTML5 backend for React DnD [Legacy Repo]
MIT License
146 stars 97 forks source link

Preview position wrong with absolute positioned elements inside DragSource #61

Open danielbrodin opened 7 years ago

danielbrodin commented 7 years ago

Hey,

I have an element that I'm dragging around and it works great by itself, but that element could have an icon attached to it with position: absolute; left: -24px; which breaks the positioning.

This html5-backend doesn't care about the icon which it shouldn't, but the native drag and drop api does, since it includes the icon in the preview rendering, so when the html5-backend tries to fix the position it instead breaks it for me.

Is there a way for me to kinda hijack the positioning function and just add a couple of pixels to the x coordinate that it creates?