question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] startReached and endReached called in succession

See original GitHub issue

Describe the bug In a particular scenario,startReached and endReached called in succession.

Reproduction https://codesandbox.io/s/romantic-mountain-tzfbw

To Reproduce Steps to reproduce the behavior:

  1. once initial items are loaded, scroll up to fetch previous items
  2. observe the console logs

Expected behavior only startReached should be called.

Additional context This issue isn’t happening if I fetch the next items first and then scroll up to fetch previous items.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
petyosicommented, Jun 21, 2021

I examined the linked example in further detail, and this is going to be quite hard to fix on the lib side. Let me explain:

When scrolling up and new items are prepended, the lib scrolls down first in order to compensate for the newly introduced content. When items are prepended, the browser shifts back to where the list should be.

In your case, however, the initial amount of items is small, and the scroll-down action reaches the bottom of the list. It is fairly easy to avoid that - you need to bump the amount of the initially loaded items.

On a side note, you are also using negative values for the firstItemIndex - which causes some internal calculation issues. Start from a really large item instead.

I will keep this bug open for now, but again, fixing it is going to be quite hard (I need to detect that scrolling and ignore the end reached).

0reactions
petyosicommented, Jun 11, 2021

Nah, got it. I was not reading your report correctly

Read more comments on GitHub >

github_iconTop Results From Across the Web

There is no way to reset endReached/startReached ... - GitHub
It appears when using regular mode, you can now reset endReached by change the object reference for the data prop (see #182) but...
Read more >
CP 544 - ADEGIS
The CP 544 communications processor enables data to be transferred between your programmable controller (PLC) and.
Read more >
V5-beta: How to create a full transparent background around the ...
In this PhotoSwipe test album I tried to make the area around the slide image fully transparent, so that I see there the...
Read more >
How does chance node work in subgame solving ... - IssueHint
[BUG] startReached and endReached called in succession, 6, 2021-06-10, 2022-10-02. Implement the logic for `RequiredDuringSchedulingRequiredDuringExecution` ...
Read more >
react-virtuoso - developer blog
[BUG] startReached and endReached called in succession. once initial items are loaded, scroll up to fetch previous items 2. Additional context This issue ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found