Can I make a shape shrink and grow through overrides?

Hello :slight_smile: ,

I have a problem I’ve been trying to solve for hours but I can’t seem to find a good solution. I made a symbol of a list item which has several Text fields and it’s supposed to grow and shrink vertically depending on the overrides (eg. blanking some text fields out or adding override text which occupies more than one line).
Now usually you would just add a vertical Smart Layout and set the resizing and be done.

The problem is that I want the list item to include a vertical divider, a rectangle if you will, which is supposed to grow and shrink with said overrides. Part 1 of the problem is: It doesn’t grow properly, the layer does but the filling doesn’t. Part 2: It obviously doesn’t shrink when removing some of the text fields through blank overrides, because I suppose it wants to keep its original height that was set in the symbol.

Here’s a screenshot:

Maybe there’s someone smart out there who has a better solution than creating tons of divider symbols with different heights, which would result in tons of different list items instead of one cool flexible component. I would be super grateful about any ideas or help!

Here’s the file:
divider-issue.sketch (619.2 KB)

Thanks i advance and have a good weekend whoever reads this! :slight_smile:

Paul

Hi @paulgro

Thanks for sharing your file! I did some edits and got it working. Here’s what I changed:

  • Turn off Smart Layout for the divider line. It doesn’t even need to be a symbol, but it can work either way
  • Ungroup the text elements of the list item: name, model, IP, etc. By eliminating the group, these layers and the divider are at the same level so the line grows and shrinks when you add text or hide layers

 

Heres the file, I hope it helps :raised_hands:

Divider-issue-fixed.sketch (618.7 KB)

2 Likes