Closed itsmnthn closed 5 months ago
Can confirm that. Same issues with run
, documentchange
, stylechange
, textreview
events
I think this is happening because the callback passed to figma.on("drop", ...)
needs to return a boolean.
It should return false if it wants to handle the particular drop and stop Figma from performing the default drop behavior. https://www.figma.com/plugin-docs/api/properties/figma-on/#drop
for run
, documentchange
, stylechange
, and textreview
, it's expecting the callback passed to handle the event.
https://github.com/figma/plugin-typings/blob/master/plugin-api.d.ts#L51-L59 has a good breakdown of the expected types here
🤔 there's probably some work we could do to make the typescript errors here more clear - or make the callback requirements a bit less strict similar to how DOM events are handled but hopefully this unblocks ya'll for now!
Thanks!
Didn't notice line about returning false.
Typescript give error for registering drop event, says below