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

[BUG] Jump on first render #446

Closed
maccman opened this issue Sep 4, 2021 · 5 comments
Closed

[BUG] Jump on first render #446

maccman opened this issue Sep 4, 2021 · 5 comments
Assignees
Labels
bug Something isn't working released

Comments

@maccman
Copy link

maccman commented Sep 4, 2021

Describe the bug

We recently upgrade Virtuoso from 1.9.3 to 2.0.1. We have started to see some jumping behavior when the list is rendered.

I understand that Virtuoso is measuring items dynamically, but this never used to happen. See video for a demo.

CleanShot.2021-09-04.at.17.23.19.mp4

Do you have any pointers for us to debug this?

Implementation

        <div className="flex-1 flex-col overflow-hidden">
          <Virtuoso
            ref={virtuoso}
            width={'100%'}
            height={'100%'}
            data={notes}
            firstItemIndex={firstItemIndex}
            rangeChanged={onRangeChanged}
            initialTopMostItemIndex={noteIndex}
            endReached={onEndReached}
            startReached={onStartReached}
            itemContent={(_index, note) => (
              <DailyNoteEdit
                key={note.id}
                availableBacklinks={backlinks}
                notes={notes}
                note={note}
                fullScreen={fullScreen}
                semiScreen={semiScreen}
              />
            )}
          />
        </div>

p.s. THANK YOU so much for Virtuoso - it's epic.

@maccman maccman added the bug Something isn't working label Sep 4, 2021
@petyosi
Copy link
Owner

petyosi commented Sep 5, 2021

Thank you for the support @maccman, highly appreciated. I will examine the configuration, probably one recent bugfix I introduced causes the regression. Will let you know if I need further clues. To confirm, you're not scrolling to the last item of the list, correct?

@petyosi petyosi self-assigned this Sep 5, 2021
@petyosi
Copy link
Owner

petyosi commented Sep 5, 2021

@maccman I could not clearly reproduce the jump on my side, but examining your configuration, I believe that the regression was introduced by the setTimeout addition in 1.10.6. Can I ask for your help here? If my assumption is correct, if you install 1.10.5 the jump should not be there. Alternatively, but less likely, v1.10.3 could be the culprit, in which case installing 1.10.2 would remove the jump.

Both of those are fixable, of course. I assume you don't do anything additional on navigation or by manipulating the ref.

@maccman
Copy link
Author

maccman commented Sep 5, 2021

The jump was still there after installing 1.10.5.

However, the jump goes away if I install 1.10.2.

@petyosi
Copy link
Owner

petyosi commented Sep 5, 2021

@maccman do you do something additional with the list ref? If you want to set up a repro in your environment, I would love to observe that as well (you can reach out to my email in the GH profile).

@petyosi petyosi closed this as completed in 9127413 Sep 8, 2021
@github-actions
Copy link

github-actions bot commented Sep 8, 2021

🎉 This issue has been resolved in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants