You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use a skyhook-preview inside a modal (which is at fixed position). This forces the preview to render at the mouse position without accounting for the offset. I saw an example of how to do this in the xy pad custom drag layer example, but Im curious if it's something that could be added to skyhook-preview?
The text was updated successfully, but these errors were encountered:
In general, you can apply any style to whatever you put in the preview, including CSS translation or positioning, so it seems unlikely the skyhook-preview component would need to change to make this work.
Further, if for whatever reason the preview’s base layer is in the wrong spot (not sure how that would work, it’s already out of normal document flow), you could always move it out of whatever div it’s in. It can be in a portal to the end of <body> for it all it cares.
That's when starting a drag from the top left dot of the gripper handle, I did follow your suggestion and translate my element. Which now has it like so...
Now it seems to be a different issue when using dragSource on the gripper. It's fine if I put dragSource on the root element.
Ah, there’s something you have to do with react-dnd as well — the grabber handle is padded inside the box by the same amount that remains. Either translate the rest of the way back, or make the grabber hit the top left somehow. There might be a relevant issue upstream, have a look.
I was trying to use a skyhook-preview inside a modal (which is at fixed position). This forces the preview to render at the mouse position without accounting for the offset. I saw an example of how to do this in the xy pad custom drag layer example, but Im curious if it's something that could be added to skyhook-preview?
The text was updated successfully, but these errors were encountered: