I use drop event to receive data from plugin and create component in figma, it works fine in figma app but not in browser.
figma.on('drop', event => {
const { items, node } = event
if (items.length > 0 && items[0].type === 'text/json') {
const data = JSON.parse(items[0].data) as IconData
const instance = newIconFromData(data)
instance.x = event.x
instance.y = event.y
// not all nodes have appendChild method
;(node as PageNode | FrameNode | GroupNode | SectionNode).appendChild(instance)
figma.currentPage.selection = [instance]
return false
}
return true
})
I also tested on Material-Symbols and it doesn’t drop properly in browser too.
My os version is macos 13.2 and browser verison is chrome 110, and there’s no error message in console after I drop.
Any idea on how to solve this? Thanks.