instance.mainComponent.parent
Yeah @Gleb, it will be a combination of:
if (element.type === 'INSTANCE' + :has(variantProperties)) {
get (instance.mainComponent.parent.id)
}
Something like that…
One observation the “instance.mainComponent.parent” will be of type “COMPONENT”… but if I click the component wrapper itself for the variants the type is “COMPONENT_SET”… not sure if that is by design, but it would be good if they match
.
Thanks
That’s weird. Maybe it’s a bug in Node Inspector plugin? Have you tried using the console?
figma.currentPage.selectiont0].mainComponent.parent.type
For me this yields "COMPONENT_SET"
when the selected object is the variant set instance.
You are right, I will reach out to the plugin developer, thanks