mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
fix: fix scrollYOffset when SSR
This commit is contained in:
parent
eb8d4fd678
commit
d09c1c1086
|
@ -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;
|
||||
|
||||
|
@ -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 (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue
Block a user