diff --git a/src/common-elements/perfect-scrollbar.tsx b/src/common-elements/perfect-scrollbar.tsx index 40ae4dcc..da4b9cf3 100644 --- a/src/common-elements/perfect-scrollbar.tsx +++ b/src/common-elements/perfect-scrollbar.tsx @@ -27,7 +27,9 @@ export class PerfectScrollbar extends React.Component<{ private inst: PerfectScrollbarType; componentDidMount() { + const offset = (this._container.parentElement && this._container.parentElement.scrollTop) || 0; this.inst = new PerfectScrollbarConstructor(this._container, this.props.options || {}); + this._container.scrollTo(0, offset); } componentDidUpdate() { diff --git a/src/components/SideMenu/MenuItem.tsx b/src/components/SideMenu/MenuItem.tsx index caa14c28..fefc3a02 100644 --- a/src/components/SideMenu/MenuItem.tsx +++ b/src/components/SideMenu/MenuItem.tsx @@ -21,6 +21,13 @@ export class MenuItem extends React.Component { evt.stopPropagation(); }; + componentDidMount() { + const item = this.props.item; + if (item.type !== 'group' && item.active) { + this.scrollIntoView(); + } + } + componentDidUpdate() { if (this.props.item.active) { this.scrollIntoView();