AziiiRa
AziiiRa

Reputation: 11

Width of the Table in AutoSizer and Window Scroller is not being updated properly while resizing the browser

I am using React-Virtualized to display a table with a long list of values. So it's a combination of WindowScroller, AutoSizer and Table. I am having an issue when the browser is resized. This is my code:

  render() {
    return (
        <WindowScroller>
            {({ height, isScrolling, scrollTop }) => (
                <AutoSizer>
                    {({ width }) => (
                        <Table
                            ref={(ref: Table) => { this.TableRef = ref; }}
                            autoHeight={true}
                            height={height}
                            width={width}
                            isScrolling={isScrolling}
                            scrollTop={scrollTop}
                            _noRowsRenderer={this._noRowsRenderer}
                           ...
                            >
                            <Column
                                ...
                            />
                        </Table>
                    )}
                </AutoSizer>)}
        </WindowScroller>
    );
}

When the browser is resized the width of the table is not updated accordingly and so a vertical scroll bar is being displayed although it's not needed; unless it's zoom-in or zoom-out and then it's all redrawn-positioned correctly. Does anyone has any idea how to fix this?

Upvotes: 1

Views: 3050

Answers (0)

Related Questions