Skip to content

Commit

Permalink
fix: fix scrollYOffset when SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Sep 30, 2019
1 parent eb8d4fd commit d09c1c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/StickySidebar/StickyResponsiveSidebar.tsx
Expand Up @@ -87,7 +87,7 @@ export class StickyResponsiveSidebar extends React.Component<
> {
static contextType = OptionsContext;
context!: React.ContextType<typeof OptionsContext>;
state: StickySidebarState = {};
state: StickySidebarState = { offsetTop: '0px' };

stickyElement: Element;

Expand Down Expand Up @@ -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 (
<>
Expand Down

0 comments on commit d09c1c1

Please sign in to comment.