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:
- 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.
- 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
Thanks for all the work you all put into the Figma ecosystem.