react-virtualized icon indicating copy to clipboard operation
react-virtualized copied to clipboard

Problems with scrolling

Open yuristrelets opened this issue 9 years ago • 26 comments

I am trying to use List, something like this

<AutoSizer>
  {({ height, width }) => (
    <List
      width={width}
      height={height}
      rowHeight={48}
      rowRenderer={({ index }) => (
        <div style={{ height: 48 }} key={index}>Item {index}</div>
      )}
      rowCount={rows.size}
    />
  )}
</AutoSizer>

But instead of smoothly scrolling I get terribly jerky on chrome 61.0.3163.100 https://www.screencast.com/t/I7yRYcu71 on FF 55.0.3 I had empty space at the end https://www.screencast.com/t/JOT1Bswz

Without AutoSizer the problem doesn't disappear. I'm using the latest versions of react and react-virtualized.

What am I doing wrong? Who faced such a problem?

yuristrelets avatar Sep 25 '17 15:09 yuristrelets

Same problem here. Introduced with 9.10.0. Downgrading to 9.9.0 fixes the problem.

christiantinauer avatar Sep 25 '17 18:09 christiantinauer

Same here PS: The problem is easily reproducible running https://github.com/bvaughn/react-virtualized-select Just clone yarn; yarn start

The first select in example won't work. I have the same issue, all the controls with scrollToIndex defined seems not work. All others are fine, see gif

example-rv

PS: seems like duplicate of https://github.com/bvaughn/react-virtualized-select/issues/75

istarkov avatar Sep 25 '17 21:09 istarkov

Unfortunetely, even rolling back to version 9.9.0, and then 9.0.0 and 8.11.4, didn't solve the problem. I used version 7 for a long time and wanted to try the latest version in the new project. On version 7 there is no such problem. I have no ideas.

yuristrelets avatar Sep 26 '17 08:09 yuristrelets

@yuristrelets That's because you should pass style and key (not index) props to your div. rowHeight should be set via component props.

      rowRenderer={({ style, key, index }) => (
        <div style={style} key={key}>Item {index}</div>
      )}

TrySound avatar Sep 26 '17 08:09 TrySound

@TrySound You're right! My fault, I didn't see that it's necessary to pass style ad key. Downgrading to version 9.9.0 and changing rowRenderer solved the problem. Thank you!

yuristrelets avatar Sep 26 '17 09:09 yuristrelets

I have experienced this problem with v9.10 downgrading to 9.9.0 fixed the issue.

mtycvy avatar Sep 27 '17 12:09 mtycvy

We are seeing the same issue on 9.10.1 as well.

bradbirnbaum avatar Sep 27 '17 19:09 bradbirnbaum

Guys here is the fix https://github.com/bvaughn/react-virtualized/pull/825

istarkov avatar Sep 27 '17 20:09 istarkov

Fixed by #825

Will be released momentarily as 9.11

bvaughn avatar Oct 14 '17 18:10 bvaughn

react-virtualized ^9.20.1 still has this issue. Both jerking (after a few scrolling) and blank (after more scrolling) happen After add some dummy style it is resolved. Please reopen this issue or at least mark "style" as a compulsory parameter to avoid this.

env: mac 10.13.4 chrome 67.0.3396 node 9.2.0 yarn 1.7.0

w10036w avatar Jul 17 '18 19:07 w10036w

Facing the same issue in the react-virtualized ^9.21.0 also :(

My code's snap like: <List width=800 height=50 rowHeight=600 rowRenderer={ ({ index, style, key, ...rest }) => { return ( <Component key={key} style={style} {...this.props.items[index]} /> ) } } rowCount={items.length} />

Env: Windows10 yarn version v1.12.3 Chrome Version 71.0.3578.98

Please suggest me if I'm missing anything here.

nileshpawar-xento avatar Dec 14 '18 11:12 nileshpawar-xento

Having a similar issue on 9.21.0. Using WindowScroller and AutoSizer. When the list has no entries scrolling starts to jump once top of the list is at window top.

Screen recording: scroll-junk

Code:

        <WindowScroller>
          {({height, isScrolling, onChildScroll, scrollTop}) => (
            <AutoSizer disableHeight>
              {({width}) => (
                <List
                  ref={this.setListRef}
                  autoHeight
                  estimatedRowSize={ROW_HEIGHT}
                  height={height}
                  isScrolling={isScrolling}
                  noRowsRenderer={this.noRowsRenderer}
                  onScroll={onChildScroll}
                  overscanRowCount={2}
                  rowCount={productsListRows.length}
                  rowHeight={this.getRowHeight}
                  rowRenderer={this.rowRenderer}
                  scrollTop={scrollTop}
                  width={width}
                />
              )}
            </AutoSizer>
          )}

edgars-sirokovs avatar Jan 29 '19 15:01 edgars-sirokovs

I have the same issue as @yuristrelets. [email protected] on Chrome 75.0.3770.100. Any news? Taking into account last 3 unresponded comments.

jaxxreal avatar Jul 04 '19 15:07 jaxxreal

Same problem

Artur93gev avatar Aug 31 '19 19:08 Artur93gev

Same here, Chrome Version 76.0.3809.132 (Official Build) (64-bit). Safari works fine. [email protected]

sebastian-schlecht avatar Sep 10 '19 20:09 sebastian-schlecht

Adding one more to the pile. I am still seeing this problem in Chrome on 9.21.2.

mackinleysmith avatar May 05 '20 15:05 mackinleysmith

I used this component and modified it https://github.com/bvaughn/react-virtualized/blob/master/source/Table/defaultRowRenderer.js

ap-in-git avatar Jun 24 '20 15:06 ap-in-git

Was experiencing this on Chrome with 9.21.2. Adding style={{width: "100%", height: "100%"}} to the <AutoSizer> component itself has fixed this for me weirdly.

colecorrente avatar Aug 03 '20 18:08 colecorrente

I'm experiencing this issue with the AutoSizer and virtualized table. Sadly style tags haven't helped me and I'm experiencing a very jerky table. Has anyone figured out more about whats going on here?

chesaman12 avatar Nov 13 '20 17:11 chesaman12

In case anyone is having this issue, passing the style down to whatever actual div is rendered for the row is what fixed this for me.

I had originally passed down the style property to the row component, but I didn't use that property anywhere in the row. I then passed it down to the base row component which passed the style to the actual div creating the row.

Hope this helps anyone else.

LiranCohen avatar Dec 05 '20 12:12 LiranCohen