New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/lib: Give empty "Th" elements a aria-label attribute #20358
pkg/lib: Give empty "Th" elements a aria-label attribute #20358
Conversation
0f59eef
to
ea196a4
Compare
ea196a4
to
d06ef9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As nobody has a better idea, this should at least improve things for screenreaders and fix the warning. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this? You shouldn't add ARIA unless it's needed. Here, it's not. This is definitely not the correct approach.
If I understand it correctly, this actually would make screenreader experience worse.
What is "Select"? What does it mean? What is this actually supposed to be describing? Why don't we just have the label as normal instead of adding ARIA? "Expander" probably also doesn't make sense out of context.
Where's the actual useful screen reader parts, like the scope attribute?
OK, thanks @garrett . I have absolutely no idea what to do here, and you have too many things on your plate already. Dropping release-blocker. |
Sorry; I'd like to help out in depth, but I'm way overburdened with everything right now. Perhaps soon? Hopefully? It's important, but so is everything else. 😢 |
d06ef9a
to
3a7cfb7
Compare
We have to shut up the Patternfly warning somehow, hopefully by making our tables more accessible. But if the correct thing for accessibility doesn't also shut up the warning, we haven't won yet. In order to shut up the Patternfly warning we have to use Both The same happens when adding a empty So, this leaves us with |
Or get Patternfly to change conditions for the warning. |
Thanks for your investigations! The only remaining idea that I have is to try with an empty aria-label, and check if that quiesces PF. But I don't know how screenreaders react to this. But even if they said "empty", that'd be okay I think. On second thought it doesn't make sense to let them read "select" and right afterwards say "this is a checkbox". But at this point, I'm good with basically any hack which quiesces this, as long as it comes with a bug reference, preferably against PF. They make it actively hard to do a selectable table line correctly, so perhaps they have some idea how it should be done. |
Anything truthy will work, but a empty string is falsey. A single space shuts PF up. |
hmmkay, but that'd be even more confusing in screen readers, I figure. So I'd say let's go with this plus a "# HACK: Pf issue" reference? |
The example for a Table with expandable rows uses
Here is a good article about the difference between Conclusion:
So both have the same goal, but
shrug |
3a7cfb7
to
26eab1d
Compare
Updated to use the labels from the examples in the PatternFly documentation. |
What should the PF issue report be about? That the warning gives bad advice? I will file a issue with PF about how using screenReaderText accidentally influences column width. |
|
As requested by this warning: Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label.
26eab1d
to
c027d89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! What a yak shave..
{!onHeaderSelect && onSelect && <Th aria-label={_("Row select")} />} | ||
{onHeaderSelect && onSelect && <Th aria-label={_("Row select")} select={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test.
As requested by this warning: