Skip to content

selected item in attached callback sets to 'undefined' when carousel-slides are included using dom-repeat template #5

@spachore

Description

@spachore

I am using this component for showing dynamic content using dom-repeat template. It might happen that the imageList is blank for a short duration initially.

      <simple-carousel auto infinite-loop>
        <template is="dom-repeat" items="{{imageList}}" as="imageItem">
          <carousel-slide>
                 <img src="{{imageItem.imageURL}}">
          </carousel-slide>
        </template>
      </simple-carousel>

As the imageList is empty, the component does not get any slide to set as 'selected' item during attached callback. And the carousel fails to show any items even after the imageList gets filled with items, as the next() function does not have valid selected item.

This case of 'no-slides-initially' should be handled. The next() function should set the selected item, if it is 'undefined'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions