Auto-Layout icon indicating copy to clipboard operation
Auto-Layout copied to clipboard

Nested Stacks Collapsing Issue

Open kelly-bot opened this issue 7 years ago • 15 comments

First of all: I was so freakin thrilled when I found this plugin, it's everything I ever wanted!

Except for this minor issue... When I have nested stacks (all with "collapse" enabled,) hiding the last layer in a child-group stack doesn't cause the other sibling-group stacks to collapse beneath it. All other layers work properly, it's just the bottom layer within a group. (Update: its not necessarily the bottom layer in the layer panel, it doesn't matter what order they're in layer-wise... its the one that's visually beneath the rest in the artboard that doesn't cause anything to collapse.)

Here's a screen recording of what I'm talking about: https://www.dropbox.com/s/r18gj2fek29f636/nested%20collapsible%20stacks%20bug.mov?dl=0

I'm using Sketch v 48.2. I'm going to try reverting back to older versions in the meantime.

kelly-bot avatar Feb 07 '18 14:02 kelly-bot

Updateupdate: This only kinda sorta works, it's still a little unpredictable about what it decides will collapse and what won't.

Update: I've found a workaround, incase anyone else is having trouble with this.

I'm setting the spacing to 0 and creating blank rectangle layers to act as spacing. That way, the "last" layer isn't something I need to turn on/off, so everything collapses as expected.

screen shot 2018-02-08 at 10 49 23 am screen shot 2018-02-08 at 10 53 25 am

kelly-bot avatar Feb 08 '18 15:02 kelly-bot

I have some problem(

foxyls avatar Mar 27 '18 09:03 foxyls

+1

chriswiesner avatar Nov 30 '18 07:11 chriswiesner

+1 its always the last item in a stack

I have added an example file bug.sketch.zip

@kelly-bot I cant get your work around to fix the issue. Can you supply a template?

SimonFricker avatar Jan 17 '19 15:01 SimonFricker

This is still an issue almost a year on and it's destroying my workflows. Even better – now the workaround kelly-bot provided above isn't even working. I shudder to think how much time I've wasted trying to make stacked groups work properly across my projects.

Here's what I've observed:

  • When I hide the last element in a nested vertically stacked group, nothing happens
  • When I hide the second last element in the same group the stacked group below shifts up by the height of the last element in the initial stacked group
    • ... UNLESS the height of the second last element in the initial stacked group is less than the last element in the initial stacked group. In this case the stacked group below shifts up by the height of the second last element in the initial stacked group.

I cannot even begin to imagine why this would be the case. Genuinely perplexing and genuinely frustrating.

lachlansun avatar Jan 22 '19 00:01 lachlansun

+1

derstelli avatar Feb 08 '19 14:02 derstelli

+1

Losing my mind over this. Still happening in Sketch 53.1 + Anima 3.0.9.

jimz0 avatar Feb 15 '19 19:02 jimz0

Would love an updated sample Sketch file, @SimonFricker seems that your sample actually works with Anima 3.0.9 + Sketch 53.1.

@jimz0 @derstelli @lachlansun

avishic avatar Feb 17 '19 15:02 avishic

I can provide a sample file where collapsing also does not work.

just try to set nested symbols to None, the symbol does not "shrink" properly. also see demo-video.

https://www.dropbox.com/sh/44rhomwuzp5mlqz/AAAsu0qBAo-Xkycjawty17dua?dl=0

chriswiesner avatar Feb 18 '19 10:02 chriswiesner

I've found a workaround, incase anyone else is having trouble with this. 2019-02-26 11 18 03 put a null object in stacked group,and pull it out of the symbol @chriswiesner

ColinBai avatar Feb 26 '19 03:02 ColinBai

Hi, this problem is obviously universal and this is the cause:

When an object is hidden, it is hidden from view but it still takes space in the group.

A stack image

Middle rectangle hidden. Stack collapsed (visually), but the rectangle still takes up space. Screenshot 2019-03-21 at 10 49 27

Slaaavo avatar Mar 21 '19 09:03 Slaaavo

Still a problem for me as well!

bartberden avatar Apr 02 '19 07:04 bartberden

@ColinBai re:

I've found a workaround, incase anyone else is having trouble with this. 2019-02-26 11 18 03 put a null object in stacked group,and pull it out of the symbol @chriswiesner

I can't thank you enough for this. I had an "extra" item at the end that I would never remove from the collapsible group, thinking that would help....but it was another symbol, not a regular item. That made the difference. This is a lifesaver.

Update: Fell apart again today (5/6/19). Everything moved flush left when it's supposed to stay flush right. And all I did was change the color of an icon. This is driving me crazy and completely slowing my production down. Anima and Sketch please get together on this and get it resolved!!

usabilitymedic avatar May 03 '19 17:05 usabilitymedic

I'm running into this issue as well but it seems like the last stack item sporadically collapses correctly. Sometimes restarting Sketch fixes the collapse, sometimes tweaking the symbol works, sometimes tweaking the nested symbol works, sometimes swapping the symbol for another symbol and then swapping back works, and sometimes nothing works.

I thought for a while that it may have to do with the fix size / pin to edge function native to Sketch but I can't get consistent results.

Hopefully this gets resolved with the padding fix for Sketch 58. In the meantime, has anyone found any new workarounds?

ariviom avatar Oct 10 '19 18:10 ariviom

I've run into this issue when trying to make an accordion with stacks. It's not just the last hidden content block preventing the stack from fully collapsing - BUT - also, any symbol/group that's taller/wider than the stack itself will prevent the collapse from working.

Here's a workaround I'm using: duplicate your content symbol and make it 1px high/wide (depending on vertical or horizontal stacking). When hiding symbols, you'll need to replace it with the duplicate, set to original size, and then hide it.

The inconvenience: you may also need to create each accordion item as a separate symbol if you're working with real content, e.g the text & fields are different in each accordion item.

It's not as elegant as simply flipping the visibility - but does work with a few more steps.

Screen Shot 2021-04-22 at 7 32 09 PM

slamwiser avatar Apr 23 '21 02:04 slamwiser