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.

Safari re-renders all rows every scroll after click

See original GitHub issue

In safari, once you have simply clicked inside the List, even for super simple rows with no click handler - the List goes bananas and starts to re-render all rows on every scroll.

import React from "react";
import { List } from "react-virtualized";

export default function Playground() {
  return (
    <div style={{ height: 1000 }}>
      <List
        width={1000}
        height={1000}
        rowCount={10000}
        rowHeight={30}
        rowRenderer={({ index, key, style }) => (
          <div key={key} style={{ ...style, height: 30 }}>
            Row {index}
          </div>
        )}
      />
    </div>
  );
}

https://codesandbox.io/s/l5m9q4v7z

Tested with Safari 11.0.3

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vjeranccommented, Feb 19, 2018

I’m seeing a similar issue in Firefox and Chrome.

Scrolling just 1 px rerenders all the cells. Even if outline is added.

1reaction
TrySoundcommented, Jan 29, 2018

@piotrblasiak Would you like to send a PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React.js: Stop render from scrolling to top of page
E.g. User adds a row to a table, and then you fire a render adding that row. Is there any way to stop...
Read more >
React Hooks for infinite scroll: An advanced tutorial
Learn how to build your own React Hook for infinite scroll, along with some advanced features that will take your app to the...
Read more >
overscroll-behavior - CSS: Cascading Style Sheets | MDN
The overscroll-behavior CSS property sets what a browser does when reaching the boundary of a scrolling area.
Read more >
How to stop re-rendering lists in React? - Alex Sidorenko
Components always re-render​​ First, let's simplify our example by removing all props from the Item . We will still update the parent state...
Read more >
Understanding Repaint and Reflow in JavaScript | The Startup
On the other hand, there might be DOM elements that are represented with more than one node in the render tree-like text nodes...
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