figma / plugin-samples

🔌 Sample Figma plugins.

Home Page:https://www.figma.com/plugin-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

skipInvisibleInstanceChildren Not working

thanhnd45 opened this issue · comments

I am developing a plugin for myself, I want to find all TextNodes and ignore nodes that are hidden. Do I use figma.skipInvisibleInstanceChildren = true;
but the result, I get in the function fillAll() still contains the hidden node (its parent is hidden)

My code:

figma.skipInvisibleInstanceChildren = true; figma.showUI(__html__);

function getAllText(){ let listNodeSelected = figma.currentPage.selection let listTextNode = [] for (const node of listNodeSelected){ let textNodes = node.findAll((node) => node.type === "TEXT"); listTextNode = listTextNode.concat(textNodes) } }

image

image

How to implement skipInvisibleInstanceChildren?