From 53d6e18e815be96a50270c4998175e9c10032330 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 04 Aug 2025 05:44:35 +0000
Subject: [PATCH] fix(a11y): aria-controls and role fixes
---
quartz/components/Explorer.tsx | 7 +++++--
1 files changed, 5 insertions(+), 2 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 @@
collapsed: boolean
}
+let numExplorers = 0
export default ((userOpts?: Partial<Options>) => {
const opts: Options = { ...defaultOptions, ...userOpts }
const { OverflowList, overflowListAfterDOMLoaded } = OverflowListFactory()
const Explorer: QuartzComponent = ({ cfg, displayClass }: QuartzComponentProps) => {
+ const id = `explorer-${numExplorers++}`
+
return (
<div
class={classNames(displayClass, "explorer")}
@@ -77,7 +80,7 @@
type="button"
class="explorer-toggle mobile-explorer hide-until-loaded"
data-mobile={true}
- aria-controls="explorer-content"
+ aria-controls={id}
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -116,7 +119,7 @@
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
- <div class="explorer-content" aria-expanded={false}>
+ <div id={id} class="explorer-content" aria-expanded={false} role="group">
<OverflowList class="explorer-ul" />
</div>
<template id="template-file">
--
Gitblit v1.10.0