Skip to content

Dynamic data not working #10

Open
Open
@MarcWadai

Description

@MarcWadai

When clicking on a button the data from my scroller are updating. But even by updating the index and count. The scroller information are going to stay the same. Is there a way to use the scroller with information that update in time ? Here are an example of my code :

The data that is updating below is the array myPhotos

<Scroller
  top={0.2}
  bottom={0.8}
  bind:index
  bind:offset
  bind:progress
  bind:count>
  <div slot="background">
    <div
      class={index % 2 == 0 ? 'background_wrapper-left' : 'background_wrapper-right'}>
      <div class="background_content" out:fade>
        {#if myPhotos && myPhotos[index]}
          <p>{myPhotos[index].description}</p>
        {/if}
      </div>
    </div>
  </div>

  <div slot="foreground">
    {#each myPhotos as item}
      <section>
        <div class="m_picture">
          {#if visible && myPhotos[index] && myPhotos[index].name == item.name}
            <div class="m_picture-title">
              <span>{item.title}</span>
              <span>{item.location}</span>
            </div>
          {/if}
        </div>
      </section>
    {/each}
  </div>
</Scroller>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions