vzxipsule: Silence the carousel live region while it rotates and pause it on keyboard focus
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user