facebookarchive / fixed-data-table

A React table component designed to allow presenting thousands of rows of data.
http://facebook.github.io/fixed-data-table/
Other
4.3k stars 553 forks source link

Slow/janky scrolling when using mouse wheel #455

Closed stevenmusumeche closed 6 years ago

stevenmusumeche commented 8 years ago

I've implemented a sample table with about 150 records. When I use my mouse wheel and scroll up and down quickly, the behavior gets janky and I see this warning in the Chrome console:

Handling of 'wheel' input event was delayed for 159 ms due to main thread being busy. Consider marking event handler as 'passive' to make the page more responive.


const TextCell = ({rowIndex, data, columnKey, ...props}) => (
    <Cell {...props}>
        {data[rowIndex][columnKey]}
    </Cell>
);

constructor(props) {
        super(props);
        this.state = {
            filter: '',
            data: [
                {name: '31343'},
                {name: '43942'},
                // more data ...
            ],
        };
    }

render() {
        const {data} = this.state;
        return (
                <div className="customer-list">
                    <Table
                        rowHeight={30}
                        headerHeight={50}
                        rowsCount={data.length}
                        width={1000}
                        height={500}
                    >
                        <Column
                            columnKey="name"
                            header={<Cell>Name</Cell>}
                            cell={<TextCell data={data} />}
                            width={240}
                        />
                    </Table>
                </div>
        );
    }
rayozerets commented 8 years ago

I've the same problem( https://github.com/facebook/fixed-data-table/issues/451

KamranAsif commented 7 years ago

Your render might be too heavy. See my comment on #451

seanmadi commented 7 years ago

I had this problem as well, even after changing my component to a PureComponent. Upgraded Chrome to version Version 54.0.2840.98 and now it seems to be resolved.

Edit: I actually started getting the problem again after upgrading but then realized what the problem was. If the Chrome React Inspector is open, the scrolling is constantly jittery and freezes. But once I close the React Inspector, everything works fine.