0

I want to create a structure where i have a list and i can animate each item of the list with hero transitions. But if i make it like this then all items get on top of each other... What should I do?

  <template repeat="{{item in items}}">
                    <div layout vertical  content
                         flex>
                        <core-animated-pages  content
                                              layout vertical flex > 
                            <section>
                                <paper-shadow class="chain">
                                    {{item}}
                                </paper-shadow>
                            </section>
                            <section>
                                {{item.artists}}
                            </section>
                        </core-animated-pages>
                    </div>
                </template>
MegaX
  • 596
  • 2
  • 11
  • 23
  • This question already exists, here it is: [http://stackoverflow.com/questions/28132532/polymer-core-transitions-for-animated-pages-with-core-list-content][1] [1]: http://stackoverflow.com/questions/28132532/polymer-core-transitions-for-animated-pages-with-core-list-content – Goce Ribeski Feb 06 '15 at 09:53
  • no this is not the same question. – MegaX Feb 06 '15 at 10:28

1 Answers1

1

To keep the items from overlapping you need to make sure that your element has a height. You can do this by using layout attributes on the body itself and your custom element instance.

<body fullbleed layout vertical>

  <polymer-element name="x-foo">
    <template>
      <template repeat="{{item in items}}">
        <div layout vertical flex>
          <core-animated-pages layout vertical flex> 
            <section>
              {{item.artist}}
            </section>
          </core-animated-pages>
        </div>
      </template>
    </template>
    <script>
      Polymer({
        items: [
          {
            artist: 'Some dude'
          },
          {
            artist: 'Some other dude'
          }
        ]
      });
    </script>
  </polymer-element>

  <x-foo layout vertical flex></x-foo>

</body>

Example jsbin

robdodson
  • 6,616
  • 5
  • 28
  • 35