Describe the problem
Edit 4/11/2025:
This issue should be scoped to just updating how we're defining the default value of the aria-label on Spinner. Ideally we want the default value to be rendered in the props table, rather than rendering as though there isn't any default value currently.
Original comment:
The Spinner component hardcodes aria-label attribute when neither aria-label nor aria-labelledby is provided.
|
{...(!ariaLabel && !ariaLabelledBy && { 'aria-label': 'Contents' })} |
How do you reproduce the problem?
Mount a Spinner without providing an aria-label or aria-labelledby.
Expected behavior
A spinner without a hardcoded English value. The component should allow consumers to use it without aria-label or aria-labelledby. It might be just a complementary visual hint hidden from the a11y tree using aria-hidden when rendered alongside relevant text.
Is this issue blocking you?
Somehow. A workaround exists by setting aria-labelledby, but it would be preferable if, as said above, the spinner could be used as a visual hint for sighted users while being excluded from the a11y tree.
Screenshots
N/A
What is your environment?
N/A
What is your product and what release date are you targeting?
N/A
Any other information?
Jira Issue: PF-1462
Describe the problem
Edit 4/11/2025:
This issue should be scoped to just updating how we're defining the default value of the aria-label on Spinner. Ideally we want the default value to be rendered in the props table, rather than rendering as though there isn't any default value currently.
Original comment:
The
Spinnercomponent hardcodesaria-labelattribute when neitheraria-labelnoraria-labelledbyis provided.patternfly-react/packages/react-core/src/components/Spinner/Spinner.tsx
Line 47 in 3ba79b0
How do you reproduce the problem?
Mount a
Spinnerwithout providing anaria-labeloraria-labelledby.Expected behavior
A spinner without a hardcoded English value. The component should allow consumers to use it without
aria-labeloraria-labelledby. It might be just a complementary visual hint hidden from the a11y tree usingaria-hiddenwhen rendered alongside relevant text.Is this issue blocking you?
Somehow. A workaround exists by setting
aria-labelledby, but it would be preferable if, as said above, the spinner could be used as a visual hint for sighted users while being excluded from the a11y tree.Screenshots
N/A
What is your environment?
N/A
What is your product and what release date are you targeting?
N/A
Any other information?
The Spinner props documentation does not mention a default value for
aria-label.This behavior was introduced in commit 09733cb as part of chore(a11y): update a11y tests, fix a11y errors, turn on a11y coverage #6730, but I was not able to find the reasoning there.
aria-valuetextalso has a hardcoded default value, even when it may not be applicable.Jira Issue: PF-1462