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

Vertical virtual scroller causing flaky image index change without explicit invocation #570

Closed
maranmaran opened this issue Aug 2, 2023 · 2 comments

Comments

@maranmaran
Copy link

What is the expected behavior?

Vertical scroll doesn't change item index

What is the current behavior?

Images jitter and jump index on vertical scroll

image

Two days valid link: https://streamable.com/rguhly

What are the steps to reproduce?

I have virtual scrolling grid.

When I go out of view with the gallery and in fast manner pull the vertical scroll back, sometimes (frequently) I get different item index as my first, and it kind of jumps between few photos.

Stackblitz

I'll post repro issue when I get the time.

Which versions are you using for the following packages?

Angular: 16
Gallery: ^11.0.0

My setup code:

 ngOnDestroy() { this.ref.destroy() }

 private async setupGallery() {
    
    // this gets or creates the ref and adds images to it
    await this.addItemsToGallery(); 

    this.ref.set(0, 'instant'); // set 0 as index - (should see no jumping of images)
  }

The html is wrapped in virtual scroll component.
However, I don't think that should bother it.

My image data are always in consistent order
I'm forcing the index to be set as 0 but even so on init I see this jumping when I scroll or even refresh the page

@maranmaran maranmaran changed the title Virtual scrolling causing horizontal image scroll invocation Vertical virtual scroller causing flaky image index change without explicit invocation Aug 2, 2023
@MurhafSousli
Copy link
Owner

I see, yes it is better to have a reproduction, there are couple of options we can try

@MurhafSousli
Copy link
Owner

MurhafSousli commented Dec 23, 2023

Please try with the newer version 12 beta npm i ng-gallery@beta, closing this for now... feel free to reopen if you still encounter the issue

#583

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

2 participants