vzxipsule: Silence the carousel live region while it rotates and pause it on keyboard focus

This commit is contained in:
2026-10-19 22:31:56 -06:00
parent ce1a3e2eaa
commit cf45072f27
4 changed files with 49 additions and 11 deletions
+10
View File
@@ -56,3 +56,13 @@ export function startFeaturedAutoplay(opts: {
stop() { if (timer) clearInterval(timer); },
};
}
/**
* WAI-ARIA carousel pattern: a rotating carousel must not announce every
* slide, so the region is `off` while autoplay runs and `polite` when the
* person has paused it (hover, focus) or it never rotates (reduced motion,
* a single expert).
*/
export function featuredLiveMode(opts: { rotating: boolean; paused: boolean }): "off" | "polite" {
return opts.rotating && !opts.paused ? "off" : "polite";
}