code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

"Booleans" which are actually Variants in Figma seem to cause an issue with code connect if they are not "true/false" but "yes/no"

Open konki-vienna opened this issue 1 year ago • 1 comments

We have a Button component in Figma with two different sizes: default and small. As this affects the height of the Button component it cannot be a Boolean prop, but has to be a Variant prop (with just two values). In the Figma properties panel, there is a Switch "Small" which can be toggled off (for default) or on (for small). The values of a Variant prop in Figma (used as a boolean) can be either "yes"/"no" or "true"/"false".

Our Button component used "yes"/no"", which is fine for the Figma component. However, the boolean in code-connect always returned "false".

By changing the prop's values in Figma to "True"/"False", I managed to get the code-connect property to work:

small: figma.boolean('Small', { true: Button.SIZE.SMALL, false: undefined, . }),

So, it seems to me whilst Figma is not having any issues with Variant props named "Yes"/"No" (instead of "True"/"False"), code connect expects "True"/"False".

konki-vienna avatar Jun 20 '24 13:06 konki-vienna

Hi @konki-vienna, thanks for reporting this! We're aiming to have this fixed in the next release.

karlpetersson avatar Jun 25 '24 17:06 karlpetersson