AnimaApp / Auto-Layout

Auto Layout for Sketch
https://animaapp.github.io/Auto-Layout
856 stars 40 forks source link

Nested Stacks Collapsing Issue #67

Open kelly-bot opened 6 years ago

kelly-bot commented 6 years ago

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 commented 6 years ago

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

foxyls commented 6 years ago

I have some problem(

chriswiesner commented 5 years ago

+1

SimonFricker commented 5 years ago

+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?

lachlansun commented 5 years ago

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:

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

derstelli commented 5 years ago

+1

jimz0 commented 5 years ago

+1

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

avishic commented 5 years ago

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

chriswiesner commented 5 years ago

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

ColinBai commented 5 years ago

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

Slaaavo commented 5 years ago

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

bartberden commented 5 years ago

Still a problem for me as well!

usabilitymedic commented 5 years ago

@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!!

ariviom commented 5 years ago

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?

slamwiser commented 3 years ago

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