Skip to main content

Hi I want to set constraints for a Text Node but it seems like the property is read-only Constraints · Figma Developers

Also, I don’t find any method or way to set the constraints.

How can I do it?

Thank you,

To change read-only properties, you need to overwrite the entire object or array. In your case, you need to overwrite the object, and the code will look like this:


node.constraints = {
horizontal: "MAX",
vertical: "MAX"
}

Read more about editing properties on the Figma Developers:

figma.com

Reply