Skip to content

Commit

Permalink
fix: restore sticky position of sidebar and table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil committed Jul 4, 2023
1 parent 119c836 commit de2d435
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,20 @@ export const HeroVideo: React.FC<HeroVideoProps> = ({
await play()
}

const onEnded = async () => {
await play()
}
const onEnded = () => play()

const onLoadedMetadata = () => play()

useEffect(() => {
const root = document.querySelector<HTMLDivElement>('#__docusaurus')
if (!root) return

root.classList.add('overflow-hidden')

return () => {
root.classList.remove('overflow-hidden')
}
}, [])

return (
<>
Expand Down Expand Up @@ -75,6 +86,7 @@ export const HeroVideo: React.FC<HeroVideoProps> = ({
autoPlay
onEnded={onEnded}
onCanPlay={onCanPlay}
onLoadedMetadata={onLoadedMetadata}
ref={ref}
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion packages/logos-docusaurus-theme/src/client/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ code {
overflow: auto;
}

#__docusaurus {
.overflow-hidden {
overflow: hidden;
}

Expand Down

0 comments on commit de2d435

Please sign in to comment.