[Bug] I Found a Solution to My Issue, Seems Like a Caching Bug

Hey Figma!

I just wanted to share a quick update and what seems to be a bug I encountered while finding a solution to the issue I posted about here:

The Problem

It looks like there’s some weird caching behavior going on with icon components. When I set my button to a small or xsmall size, I noticed that the variables also change the icon size automatically. This is where it gets a bit tricky—the icon layer that I’ve labeled as “icon” suddenly switches back to its default name from the icon library (e.g., “brand/persona”).

Because of this, the boolean variable I use to toggle the visibility of the icon ends up detached or doesn’t work as expected. :sweat_smile:

The Workaround

Here’s what I found works:

If I change the icon to a different one, say “icon/delete”, and then switch it back to the original icon, the layer name resets correctly to “icon”, and the boolean toggle starts working as expected again. It seems like the component is somehow getting stuck in a cached state when the size changes.

My Thoughts

I’m hoping this can help others who might run into the same issue or even give the team some insight for troubleshooting. It’s not a major blocker but definitely something that caused confusion until I figured out this workaround!

Let me know if anyone else has faced this, and if so, how did you solve it? Would love to hear your thoughts or if this could be something worth looking into further.

Cheers! :sparkles:

Let me know if you’d like to adjust anything or if this works as-is! :blush: