-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
variant restriction boolean bug #45
Comments
Hey @alisonjoseph, I think what could be going on here is that your property in Figma is actually a variant property with "boolean-like string values" rather than a true boolean. It might be the string We automatically translate these "boolean-like" strings to boolean values when using I think this is something we should fix, so that the API is consistent across props and variant restrictions. Feel free to share a screenshot of your component's properties in Figma if you're not sure, and if this isn't the case we'd be happy to investigate further. |
Thanks for the quick response @tomduncalf-figma , you're correct I think that's exactly what was happening. I'm no longer seeing an error, however it seems to be ignoring the variant restriction completely and just rendering the first one no matter if actionable is true or false. const sharedNotificationProps = {
.....
actionable: figma.boolean('Actionable'),
};
figma.connect(
ActionableNotification,
'https://www.figma.com...',
{
variant: { Actionable: 'True' },
props: sharedNotificationProps,
example: ({ title, kind, subtitle, hideCloseButton, actionable }) => (
<>
actionable: {actionable}
<ActionableNotification
kind={kind}
title={title}
subtitle={subtitle}
hideCloseButton={hideCloseButton}
lowContrast={lowContrast}
/>
</>
),
}
);
figma.connect(
InlineNotification,
'https://www.figma.com....',
{
variant: { Actionable: 'False' },
props: sharedNotificationProps,
example: ({ title, kind, subtitle, hideCloseButton, actionable }) => (
<>
actionable: {actionable}
<InlineNotification
title={title}
kind={kind}
subtitle={subtitle}
hideCloseButton={hideCloseButton}
/>
</>
),
}
); |
This appears to be working / fixed. thanks! |
I'm getting the following error when trying to create a variant restriction with a boolean property
The Figma Variant "Actionable" does not have an option for true
When creating my code connect file the property comes through:
figma.boolean('Actionable')
, and I can see it in Figma also. Is this a bug, or is my implementation incorrect?The text was updated successfully, but these errors were encountered: