From 394df91bb726593628cb4d6f9bd8a81cbf5b4092 Mon Sep 17 00:00:00 2001 From: J-michalek Date: Mon, 17 Aug 2026 09:39:03 +0200 Subject: [PATCH 1/2] fix(Slider): forward aria attributes to the thumb The thumb is the element rendered with `role="slider"`, so route consumer `aria-*` attributes there instead of the root, which is neither focusable nor labelable. Dropping the hardcoded label also restores Reka UI's own `Minimum`/`Maximum` and `Value n of m` names for multi-thumb sliders, and lets `aria-valuetext` through. A single unnamed thumb still falls back to `Thumb` so it is never left nameless. Closes #6782 --- docs/content/docs/2.components/slider.md | 4 + src/runtime/components/Slider.vue | 28 ++++-- test/components/Slider.spec.ts | 87 +++++++++++++++++++ .../__snapshots__/Slider-vue.spec.ts.snap | 16 +++- .../__snapshots__/Slider.spec.ts.snap | 16 +++- 5 files changed, 140 insertions(+), 11 deletions(-) diff --git a/docs/content/docs/2.components/slider.md b/docs/content/docs/2.components/slider.md index 3be12a30be..bb8f9aee5f 100644 --- a/docs/content/docs/2.components/slider.md +++ b/docs/content/docs/2.components/slider.md @@ -36,6 +36,10 @@ props: --- :: +::tip +Use `aria-label` or `aria-labelledby` to name the Slider, they are forwarded to the thumb which is the element with the `slider` role. Sliders with two thumbs are named `Minimum` / `Maximum` automatically and those with three or more `Value n of m`, so you only need this when a single thumb has no visible label. +:: + ### Min / Max Use the `min` and `max` props to set the minimum and maximum values of the Slider. Defaults to `0` and `100`. diff --git a/src/runtime/components/Slider.vue b/src/runtime/components/Slider.vue index 50c2a7fb11..2d9feb0d6a 100644 --- a/src/runtime/components/Slider.vue +++ b/src/runtime/components/Slider.vue @@ -44,7 +44,7 @@ export interface SliderEmits {