Figma Support Forum

Drag and drop from plugin window

Hey there,

I’m working on drag-and-drop functionality for my icon library plugin Phosphor Icons, and thanks to an excellent demo from jackiecorn on GitHub, it’s working beautifully. But there are a few pain points I was hoping the Figma developers could address:

  1. In order to compute the canvas position of a dropped element, you have to do some hand-wavy math to figure out if the UI (sidebars and toolbars) are visible, and factor that in to your insertion coordinates. It would be super helpful if the API exposed a way to determine whether the UI was visible, and if so, what size they are. Or even better, a translation of plugin coordinate-space to canvas coordinate-space.
  2. The canvas does not appear to accept drop events from drag initiated in a plugin window (drop is handled through the Figma API, but the cursor always appears as not-allowed). It would improve the discoverability for plugin users if it could appear as a copy or move cursor:

Thanks for all the work you all put into the Figma ecosystem.

2 Likes

I know that this was posted a while ago, but did you ever find a solution?

I didn’t, just living with the imprecise functionality I have now.