Skip to main content
Question

Cannot access the layers inside the widget using getNodeById

  • July 28, 2023
  • 1 reply
  • 241 views

I can select a layer/node inside a widget by expanding the widget layers in the sidebar, I can get the nodeId by typing figma.currentPage.selection[0].id in console but I cannot find the same layer using figma.getNodeById().

I have a frame in my widget where a user can paste other nodes inside it and I want to save this data on WidgetNode using setSharedPluginData. Can anyone explain how can I do it?

This topic has been closed for replies.

1 reply

tank666
  • 4873 replies
  • July 28, 2023

If you insert a widget into a design file, you can view widget sublayers in the layers panel. This allows you to select individual layers and adjust their properties.

You can only view layers and adjust properties for widgets that are still in development. You can’t do this with published versions of the widget.
Prototyping Widget UI | Widget API

Use setSharedPluginData directly on the WidgetNode.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings