mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 01:37:32 +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;
 | 
					  static contextType = OptionsContext;
 | 
				
			||||||
  context!: React.ContextType<typeof OptionsContext>;
 | 
					  context!: React.ContextType<typeof OptionsContext>;
 | 
				
			||||||
  state: StickySidebarState = {};
 | 
					  state: StickySidebarState = { offsetTop: '0px' };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  stickyElement: Element;
 | 
					  stickyElement: Element;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -122,7 +122,7 @@ export class StickyResponsiveSidebar extends React.Component<
 | 
				
			||||||
  render() {
 | 
					  render() {
 | 
				
			||||||
    const open = this.props.menu.sideBarOpened;
 | 
					    const open = this.props.menu.sideBarOpened;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const top = this.state.offsetTop || this.getScrollYOffset(this.context);
 | 
					    const top = this.state.offsetTop;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
      <>
 | 
					      <>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user