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

v9.12 List not working in Chrome v62: scroll bar sticks, rows flicker, fail to render #867

Closed
christophercliff opened this issue Nov 3, 2017 · 4 comments

Comments

@christophercliff
Copy link

christophercliff commented Nov 3, 2017

Example: https://plnkr.co/edit/pXffbuQpJ8ZPumRCVg2G?p=preview

Usage like:

const htmlEl = document.body.appendChild(document.createElement('div'))
ReactDOM.render(React.createElement('div', {
    style: {
        background: 'pink',
        height: 600,
        width: 600,
    },
}, React.createElement(ReactVirtualized.List, {
    height: 600,
    width: 600,
    rowCount: 1000,
    rowHeight: 20,
    rowRenderer: function (options) {
        return React.createElement('div', {
            key: options.index,
            style: { height: 20 },
        }, 'asdf')
    }
})), htmlEl)

virtualized-list

@christophercliff
Copy link
Author

I had missed the style prop on the row renderer.

@farfromrefug
Copy link

farfromrefug commented Nov 20, 2017

@christophercliff Can you explain how you fixed it? I have the same issue and can't get it to work, even with your example
EDIT: actually finally understood what it means

@christophercliff
Copy link
Author

christophercliff commented Nov 20, 2017

Explained here: https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#rowrenderer

rowRenderer = ({ style }) => (<div style={style} />)

@marsonmao
Copy link

I've stuck in this for a few hours too, so you just have to wrap an additional <div style={style}> outside your true element then it's all fine. The style passed into rowRenderer() is like this:

height: 63px
left: 0px
position: absolute
top: 0px => varying for all list elements, like 63px, 126px...etc.
width: 100%

so wrap the element with this style then react-virtualized's List could correctly control the positions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants