Skip to main content

Preserve overrides in instances swapped inside component


ashygee

Hi folks! I’ve seen the posts regarding text overrides with nested interactive components but I’m seeing a similar issue with non-interactive components as well.

In the example below, I’ve set my text layers to all use the same layer name and have the same hierarchy structure but if I swap one of the nested components it resets everything. Everything works perfectly if each atom component is used individually and not nested in another component though so I’m left 🤔. Any thoughts?

25 replies

Gleb
  • Power Member
  • 4710 replies
  • March 26, 2021

This is expected behavior. Figma doesn’t preserve overrides this way. I’m working on the improvements for my plugin Master which would allow you to do that in the future. I’m wondering why are you using text styles as components instead of, you know, text styles?


ashygee
  • Author
  • 7 replies
  • March 26, 2021

@Gleb we’re using text components so that there is a much more user friendly format for our team to work with text without needing to know which utility to use. On a maintainer level we are still applying text styles but are working to remove this layer of abstraction from our team in order to simplify their experience within Figma.

Since this is expected behavior it would be great to see this type of override carryover in the future. Having the capability in the future for nested components to preserve overrides would not only be great but would help us to make more powerful components.


Gleb
  • Power Member
  • 4710 replies
  • March 26, 2021

Thanks for the detailed explanation, that makes sense!


cupps
  • 7 replies
  • April 15, 2021

Chiming on this as something I would also very much like to see! I have started running into this often, as I have am finding nesting components within my variants helps cut down on edits. (I create a core component that I then create instances of to build a variant. This helps if I ever update the layout or a core element of the design, I can just update the core component and it applies to all the variants instead of needing to update each variant.)

Might be worth adding this as a post under Product Ideas as well. 🤔


ashygee
  • Author
  • 7 replies
  • April 15, 2021

Will do @cupps ! I’m glad another person resonates with this.


Gleb
  • Power Member
  • 4710 replies
  • April 25, 2021

I recently released an update to Master plugin that would allow you to do that now when you swap components with it! Here is a small demo:

twitter.com

Try it out and let me know if you have any questions.

I also renamed this topic for clarity and moved this topic to #product-feedback so anyone can vote for this feature to be implemented natively.


ashygee
  • Author
  • 7 replies
  • July 27, 2021


@cupps I think that Figma has fixed this!


ashygee
  • Author
  • 7 replies
  • July 27, 2021

ack no nevermind i wasn’t showing the same instance. apologies for the jump start excitement.


Ode
  • 1 reply
  • September 8, 2021

Can someone explain why this is “expected” behavior? It’s very common for me to use a variant of a button (or any UI control) in a component. And after I have created a bunch of instances of that component (and overridden their content), I go back to the master and change the button to another variant, which causes all the overrides to reset. 😦

Is this not a common use case for everybody?

Thanks, -Ode


Joseph_Astorga

I don’t know if this answer the question or solve something. But i also had som issues with variations of a checkbox that doesn’t keep the override if i for example change state from default to selected.

I experimented a bit and noticed that when i changed all the names of the label text layer to “Label” instead of them having unique layer names i noticed that the override works when i change between variants.

Skärmavbild 2022-02-08 kl. 16.53.55


Daniel_Cole

I’m having this issue as well trying to build out an accordion with interactive components. All my naming in the list overrides go away when the interactive component toggles states. Too bad kinda of a deal breaker for interactive components for me for most use cases.


Slava_Bronevitskiy

Having this issue even with layer names being 100% the same.


p.o-donovan

Amazing trick!!! I wonder does this work in other contexts, not just text…


Joseph_Astorga

I’m glad u like it!
Might work 🙂 I only tested this with text elements. This is currently my go to setup for labels or other text layers in components that i want to keep between different variations. Like keeping the label name while switching between a radiobutton component, text input or checkbox component, as long as you use the same layer name the override follows.


Joseph_Astorga

I got curious and tested it. I noticed that this even works for like a rectangle with an image. The overrides follows if the same principle of naming layers identical between components is applied 🙂


Joseph_Astorga


Ian_Gatt
  • 1 reply
  • March 30, 2023

I am experiencing this same issue atm… I would love it if there was a better way how to control/prevent text overrides


Hello Figma community - has there been a fix for this issue? I’m running into this problem and it overrides all my text and it’s driving me crazyy!


We are having a similar issue.
Here are the steps to reproduce this ( please see photos )

  • base component with 2 variants, a text property for the label is defined

  • parent 1 has an instance of base component

  • parent 2 has 2 instances of parent 1

  • change the text of the 2 instances in parent 2

  • change the variant of one of the instances in parent 2, the text override is maintained.

  • change the variant of Parent 1

  • the text override in the Parent 2 instances is reset if you change the Parent 1 instance’s variant, but sometimes it does not.
    Mostly the instance’s text override value is preserverd, but sometimes the value of the text override is reset.
    It seems to affect the first child of Parent 2 but never the second in this case.

  • this is happening for instance swap components as well, the context is a row made up of cells which have variants that define their width. When changing the cell width, the text override on the component inside the cell is being reset.


I just wanted to mention also that, exposing properties from nested instanced in Parent 1 didn’t solve this issue.

This was not an issue when I created and started using these components which was about 10 months ago.
I was only made aware of the issue starting about a month or so ago.

We could change the Cell width variant that was nested inside a default table row and it would completely preserve the text override and / or component swap inside the Cell


  • 4 replies
  • August 15, 2023

I’m running into this issue as well. It’s definitely a bug since at times it works (10% of the time) and then it doesn’t. Hope this will be fixed soon 🙏

Even naming the text layer the same for all variants, setting a property for the text… nothing works to keep overrides. Super annoying.

Wanted to attach a video but not allowed yet.


  • 4 replies
  • August 15, 2023

Link to my video where this is happening: https://twitter.com/jnetzlr/status/1689656962865082369?s=20


Julia57
  • Active Member
  • 45 replies
  • July 19, 2024

This is a huge dealbreaker for using atoms inside of parent components…


Gabriel_R
  • New Member
  • 6 replies
  • September 4, 2024

This was fixed with text properties, right?


Yara_Farhat3

Is this still an issue after 3 years, It doesnt always work! 
in the same component one variant works while the other doesnt, they both use the same nested text component. the only difference is that one has a radio button before the text. 
Not sure what I am doing wrong 😕


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings