From 53d6e18e815be96a50270c4998175e9c10032330 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 3 Aug 2025 22:44:35 -0700 Subject: [PATCH] fix(a11y): aria-controls and role fixes --- quartz/components/Explorer.tsx | 7 +++++-- quartz/components/OverflowList.tsx | 4 ++-- quartz/components/TableOfContents.tsx | 9 +++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx index 56784f1..e4cbcab 100644 --- a/quartz/components/Explorer.tsx +++ b/quartz/components/Explorer.tsx @@ -55,11 +55,14 @@ export type FolderState = { collapsed: boolean } +let numExplorers = 0 export default ((userOpts?: Partial) => { const opts: Options = { ...defaultOptions, ...userOpts } const { OverflowList, overflowListAfterDOMLoaded } = OverflowListFactory() const Explorer: QuartzComponent = ({ cfg, displayClass }: QuartzComponentProps) => { + const id = `explorer-${numExplorers++}` + return (
) => { type="button" class="explorer-toggle mobile-explorer hide-until-loaded" data-mobile={true} - aria-controls="explorer-content" + aria-controls={id} > ) => { -
+