Open scudco opened 4 years ago
Thanks for a thorough bug report. You're right, we have a bug when the direct child of animated-each
(or animated-value
or animated-if
, which use the same implementation) is another animator component, including AnimatedContainer
.
Any updates on a fix for this? Thanks
I have encountered this error too. Anyway to fix this error?
Describe the bug When deeply nesting
<AnimatedContainer>
s in an{{animated-each}}
without wrapper elements, the inner containers end up having.ember-animated-hidden
applied to them.To Reproduce The twiddle would not work with the latest version of ember-animated (0.9.0) so I made a repo here https://github.com/scudco/ember-animated-nesting
However, I did notice that this behavior does not occur on the twiddle using ember-animated 0.5.4 https://ember-twiddle.com/9c2d5587abd9ace38f7fd6dcd1807439?numColumns=2&openFiles=controllers.application.js%2Ctemplates.application.hbs
Steps to reproduce the behavior:
Expected behavior All elements should be visible without needing to wrap nested
<AnimatedContainer>
s in an explicit<div>
Screenshots
Desktop:
Additional context I'm trying to track down exactly why this is happening, but the hiding appears to occur at https://github.com/ember-animation/ember-animated/blob/41b54e791f08d3f444d3d11dd21b27839d3c14ab/addon/components/animated-each.js#L565
One of the reasons I'm attempting to deeply nest containers this way is because I have a recursive data structure that defines flexbox containers and items. Each container needs to have be able to animate its nested items and containers. Putting wrapper divs around containers necessarily messes with recursing the data structure into components that are reliant on flexbox classes.
Adding an
<AnimatedContainer>
around a container’s items breaks the container's flex layoutUsing
<AnimatedContainer>
as the flexbox container (e.g.,<AnimatedContainer class="flex flex-col">
) seems to work except it is hidden byanimated-each
unless theanimated-each
’s block is explicitly wrapped in a div (or other element). This leads back to breaking the flex layout.I'm all ears if I am tackling this problem incorrectly.