chore: tests crash fix after refactor

This commit is contained in:
Roman Hotsiy 2018-07-31 16:58:44 +03:00
parent ba22b1e352
commit 7a35a4d0de
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -29,8 +29,10 @@ export class PerfectScrollbar extends React.Component<{
componentDidMount() {
const offset = (this._container.parentElement && this._container.parentElement.scrollTop) || 0;
this.inst = new PerfectScrollbarConstructor(this._container, this.props.options || {});
if (this._container.scrollTo) {
this._container.scrollTo(0, offset);
}
}
componentDidUpdate() {
this.inst.update();