Skip to main content

Hello everyone,

I'm developing a FigJam plugin and have encountered an issue when trying to access the children of a SectionNode. The behavior seems to depend on the section's lock state, and I'd like to understand if there's a way to get the children even when the section is locked.

I've tested the following scenarios using the code snippet below:

1. Section not locked: I can successfully get the children.

2. Lock background only: I cannot get the children. The node.children property returns an empty array.

3. Children placed on the section and then the section is locked (Lock all): I can successfully get the children.

4. Section locked  (Lock all) and then children are placed on it: I cannot get the children.

I'm specifically looking for a way to get the children in scenarios 2 and 4. Is there a specific API or method to achieve this? Any insights or workarounds would be greatly appreciated. Thank you in advance!

 

 const selection = figma.currentPage.selection;
 if(selection.length === 1){
   const node = selectionc0];
   if(node.type === 'SECTION'){
     console.log(node.children);
   }
 }

 

Be the first to reply!

Reply