diff --git a/src/components/TableOfContents/TableOfContents.tsx b/src/components/TableOfContents/TableOfContents.tsx index 8761700a..30146f9d 100644 --- a/src/components/TableOfContents/TableOfContents.tsx +++ b/src/components/TableOfContents/TableOfContents.tsx @@ -10,6 +10,7 @@ import debounce from 'debounce' import { Icon } from '../_shared/Icon' import styles from './TableOfContents.module.scss' +import { isDesktop } from '../../utils/media-query' interface Props { variant: 'article' | 'editor' @@ -38,6 +39,8 @@ export const TableOfContents = (props: Props) => { setIsVisible((visible) => !visible) } + setIsVisible(isDesktop()) + const updateHeadings = () => { const { parentSelector } = props