Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I found a problem may cause images reload #481

Open
Shana-AE opened this issue Feb 8, 2022 · 0 comments
Open

I found a problem may cause images reload #481

Shana-AE opened this issue Feb 8, 2022 · 0 comments

Comments

@Shana-AE
Copy link

Shana-AE commented Feb 8, 2022

Hi, thank you for your great lib!

Problem

I recently encountered a weird situation that image immediately reloads after switch the my carousel component

(maybe) bug causes

I used directive in my component, here is some code snippet

<carousel ...>
          <carousel-item
            v-for="..."
            :key="..."
            #default="scope">
            <div
              @click="...">
              <img
                :class="{ 'is-active': scope.isActive }"
                v-lazy="scope.url">
            </div>
          </carousel-item>
        </carousel>

after debugging, I found it may be update method in beforeUpdate hook caused this problem
because when an image has been loaded, it would be added into the freeList, and later be removed from ListenerQueue. but when component update and triggered directive beforeUpdate hook, it will check if image in the ListenerQueue, add it back to ListenerQueue, and eventually cause image reloaded.

But I found it is intentionally at this commit, as I did't look much deeper into this repo, so I'm not sure whether these lines should be reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant