diff --git a/src/components/StickySidebar/StickyResponsiveSidebar.tsx b/src/components/StickySidebar/StickyResponsiveSidebar.tsx index 5b4aa394..7159dc1e 100644 --- a/src/components/StickySidebar/StickyResponsiveSidebar.tsx +++ b/src/components/StickySidebar/StickyResponsiveSidebar.tsx @@ -87,7 +87,7 @@ export class StickyResponsiveSidebar extends React.Component< > { static contextType = OptionsContext; context!: React.ContextType; - state: StickySidebarState = {}; + state: StickySidebarState = { offsetTop: '0px' }; stickyElement: Element; @@ -122,7 +122,7 @@ export class StickyResponsiveSidebar extends React.Component< render() { const open = this.props.menu.sideBarOpened; - const top = this.state.offsetTop || this.getScrollYOffset(this.context); + const top = this.state.offsetTop; return ( <>