Provide a general summary of the issue here
ProgressBar emits a console warning requiring aria-label or aria-labelledby even when aria-hidden={true} is passed.
🤔 Expected Behavior?
When aria-hidden={true} is set, no accessibility label warning should be emitted. The element is excluded from the accessibility tree, so a label is neither required nor meaningful.
😯 Current Behavior
useLabel inside useProgressBar unconditionally checks for the presence of label, aria-label, or aria-labelledby and warns if none is found — regardless of whether aria-hidden={true} is also set.
If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility
💁 Possible Solution
In useLabel (or useProgressBar), skip the label warning when aria-hidden={true} is present on the element, since the ARIA spec states that aria-hidden removes the element and its entire subtree from the accessibility tree — making labelling requirements moot.
🔦 Context
In our use case we use it as a visual indication for a step into a stepper. The steps are predefined and the bar is set to some static visual sizes (0, 50%, 100%) for either not started, in progress or completed. In this case, accessiblity-wise it does not provide the value by itself, but rather the step it is part of is the one providing accessibility value. That being said, the bar does not have an accessible value and we pass aria-hidden to it. Given the warning is being returned, we have a workaround but it's not actually correct and it should now return a warning if aria-hidden is passed.
🖥️ Steps to Reproduce
- Render
<ProgressBar value={50} aria-hidden /> from react-aria-components.
- Observe the console warning in development mode: "If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility"
- Adding aria-label="" suppresses the warning but is semantically unnecessary since the element is hidden from assistive technology
Version
1.15.1
What browsers are you seeing the problem on?
Other
If other, please specify.
Not browser-specific. Reproducible in any environment where NODE_ENV !== 'production', including Jest/jsdom and all major browsers in development mode (Chrome, Firefox, Safari, Edge).
What operating system are you using?
Windows 11
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Provide a general summary of the issue here
ProgressBar emits a console warning requiring aria-label or aria-labelledby even when aria-hidden={true} is passed.
🤔 Expected Behavior?
When aria-hidden={true} is set, no accessibility label warning should be emitted. The element is excluded from the accessibility tree, so a label is neither required nor meaningful.
😯 Current Behavior
useLabelinside useProgressBar unconditionally checks for the presence of label, aria-label, or aria-labelledby and warns if none is found — regardless of whether aria-hidden={true} is also set.If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility💁 Possible Solution
In useLabel (or useProgressBar), skip the label warning when aria-hidden={true} is present on the element, since the ARIA spec states that aria-hidden removes the element and its entire subtree from the accessibility tree — making labelling requirements moot.
🔦 Context
In our use case we use it as a visual indication for a step into a stepper. The steps are predefined and the bar is set to some static visual sizes (0, 50%, 100%) for either not started, in progress or completed. In this case, accessiblity-wise it does not provide the value by itself, but rather the step it is part of is the one providing accessibility value. That being said, the bar does not have an accessible value and we pass aria-hidden to it. Given the warning is being returned, we have a workaround but it's not actually correct and it should now return a warning if aria-hidden is passed.
🖥️ Steps to Reproduce
<ProgressBar value={50} aria-hidden />from react-aria-components.Version
1.15.1
What browsers are you seeing the problem on?
Other
If other, please specify.
Not browser-specific. Reproducible in any environment where NODE_ENV !== 'production', including Jest/jsdom and all major browsers in development mode (Chrome, Firefox, Safari, Edge).
What operating system are you using?
Windows 11
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response