Skip to main content
Solved

Nested components with variants don't change size with instance of main component

  • October 13, 2021
  • 6 replies
  • 4035 views

Kashby

When I change the state of a nested component and If that nested component changes sizes. When I create an instance of that main component, it will not adjust the size, even with auto layout.

Am I doing something wrong? Any help would be appreciated.

See gif:
component not working

Best answer by Kashby

I figured out the issue. My nested component didn’t have auto-layout applied to it. As soon as I applied auto-layout to the nested component with variants it worked.

Hopefully, this helps others.

View original
This topic has been closed for comments

6 replies

wolfr
  • 20 replies
  • October 14, 2021

It’s difficult to see what is going on in the gif, can you provide a video?


Kashby
  • Author
  • 2 replies
  • October 14, 2021

Trying to upload a video. Unable to do it. Here is a larger gif, but a trimmed section. This is showing only the instance of the main component not working.
problem-short


Erno_Tuovinen

I’ll have rhat same issue, color change works but size don’t. Tried to do icon wrapper.


Kashby
  • Author
  • 2 replies
  • Answer
  • October 14, 2021

I figured out the issue. My nested component didn’t have auto-layout applied to it. As soon as I applied auto-layout to the nested component with variants it worked.

Hopefully, this helps others.


Erno_Tuovinen

Well now I feel dump 😃 That did it. Sometimes you just lose track of nested components. In this IconWrapper case only hit was that the size was fixed not hug contents


  • 0 replies
  • November 14, 2021

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


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