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.

Scroll position cache not purged on update

See original GitHub issue

Hi, me and @giuseppeg stumbled over an issue in case of a chat with reverse scrolling behavior + scrollToIndex option. When a raw of a List gets updated and its height becomes bigger, RV is currently not recalculating the scroll position. Value of scrollToIndex remains the same before and after the update.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
bvaughncommented, Feb 20, 2017

FYI I’ve caught this in a small unit test:

it('should update scroll position to account for changed cell sizes', () => {
  let rowHeight = 20
  const props = {
    height: 100,
    rowCount: 100,
    rowHeight: ({ index }) => index === 99 ? rowHeight : 20,
    scrollToRow: 99
  }
  const grid = render(getMarkup(props))
  const node = findDOMNode(grid)
  expect(node.scrollTop).toBe(1900)
  rowHeight = 40
  grid.recomputeGridSize({
    rowIndex: 99
  })
  expect(node.scrollTop).toBe(1920)
})

The behavior demonstrated is because of this check. The helper doesn’t have enough information to detect when a cell size has changed if the size is determined by a function property.

I think the most appropriate fix is to set a flag when cell sizes are recomputed to tip the next cDU off that its scroll offset may be invalid.

Will be fixed in 9.0.1 (releasing presently)

1reaction
bvaughncommented, Feb 16, 2017

That’s a good workaround 😁 Maybe once I get 9.0.0 shipped and give it a few days for any bug reports to trickle in, I can dig into this more

Read more comments on GitHub >

github_iconTop Results From Across the Web

scroll position not remembered on pages with cache-control
Simple test case with Bugzilla: 1. Go to http://bugzilla.mozilla.org/ 2. Search for some text, like "cache". 3. Scroll down a page or two,...
Read more >
Why does Ajax reset my window scroll position to zero?
Problem : if you scroll a bit down AND THEN click on the link, you'll see that the window scroll position resets to...
Read more >
IE10 does not remember scroll position after pressing back to ...
When leaving a webpage via a link I return to the original page by clicking the back button. I used to return to...
Read more >
Page cache does not clear automatically on page save
Hi,. There are two issues. 1) Caches do not purge automatically upon saving a page. If I edit a page, click save, and...
Read more >
72852 – Scroll position is lost after hide/show element
I did not get "(IntPoint() if you have called reset in the meantime) thus overriding a scroll offset set by JS or the...
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