-
Notifications
You must be signed in to change notification settings - Fork 352
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
Bug - Th - PF warns about missing aria-label for elements that have aria-hidden="true" #10377
Comments
addressing in patternfly/patternfly#6272 |
But, that issue has label "wontfix"... Also, I can see how you plan to fix patternfly/patternfly#6643 in patternfly/patternfly#6272, but this here is about changing the condition in Th.tsx for showing the warning to
Anyway, thanks a lot for addressing this! |
Patternfly complains about empty "Th" elements, but a empty "Td" looks just the same and since we hide it anyway it doesn't hurt accessibility to use the wrong kind here. See https://github.com/patternfly/patternfly/issues/6658
Patternfly complains about empty "Th" elements, but a empty "Td" looks just the same and since we hide it anyway it doesn't hurt accessibility to use the wrong kind here. See https://github.com/patternfly/patternfly/issues/6658
Patternfly complains about empty "Th" elements, but a empty "Td" looks just the same and since we hide it anyway it doesn't hurt accessibility to use the wrong kind here. See https://github.com/patternfly/patternfly/issues/6658
"wontfix" has been removed @thatblindgeye transferring this issue to pf react |
@mvollmer I took a look at the commits/PR where this issue was mentioned in Cockpit, and some clarification may help with addressing this. From what I could tell, the warnings we have for the Th component are working as intended. In testing and some discussion regarding the issue that led to us introducing this warning, we had found that if a column is intended to have some sort of header (which would typically be most of the time if the other cells in the column contain valid data/content), it must be a Th and it must have an accessible name to try and improve accessibility. One exception is for something like a table where there may be column and row headers, and the top-left most cell is intended to be completely empty (in which case it should be a What I could use some help with clarifying is the intended structure/interaction of the table where this issue was mentioned. I might be lacking some context, so if I am please let me know, but it looks like a table is being built with a column that has Is there a specific reason why this entire column may need to be hidden from assistive tech in the first place? |
Thanks! This is very much appreciated!
In general, I agree, but I think this bug report here is still valid. Evenif we don't end up doing it in this specific case, it is still allowed to put aria-hidden on a
That handler is used for navigating to a new page with more details about the item represented by the row. Ideally, the click handler would be on the
We felt it doesn't hurt to hide it since it is decorative and redundant with the "Id" column, and hiding it does solve the accessibility issue. Maybe the icons should not be in their own column, and be part of the "Id" one? An alternative would be to not hide the icon column, give it the accessibility label "Category" and add fitting labels like "Disk", "Volume", "Network" to the icons. A bigger accessibility issue is actually the way we convey the hierearchical relationships of the rows in the table. This is done purely by messing with some CSS margins and is not exposed to AT at all... |
Oh, sorry, I could have filed this directly in patternfly-react. |
@mvollmer no worries!
Initially I might be hesitant to omit the warning for a There's also a worry of
Ah gotcha. Yeah, I almost feel like if the icons are really just decorative, putting them in another column that has some other meaningful content may be better: it doesn't require hiding an entire column from AT, and it may clear up whatever space this extra column may be taking up. Or as you said, providing additional context to the icon column and giving it a heading. That said, if a separate column is absolutely necessary/desired, hiding the entire column as you are in your Cockpit PR may be the next better alternative.
This is out of scope of the current ask/issue, but just to mention that interactive cells/rows like this sort of use case have always felt trickier from an a11y perspective 😆 One issue with applying click handlers to Again, this is out of scope for your current ask, but wanted to share in case you'd find it helpful/interesting |
So, another warning about But more seriously, your arguments make sense to me and I wont fight you if you close this as wontfix. Thanks a lot for your explanations, they have helped me understand a11y a lot more and I guess I can dtrt on my own more often now.
There is also the pattern where the content of the first column is turned into a link, like we use in cockpit-machines: That seems to avoid a lot of the problems of clickable rows. |
This issue has been automatically marked as stale because it has not had recent activity. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue has been closed because it has not had activity since being marked as stale. |
We have a empty
Th
and Patternfly rightfully demands it to be made accessible. However, in our case, the best thing is to hide the whole column from the screenreader with aria-hidden in every cell in that column. However, PF will still emit its warning for aTh
component like this:The text was updated successfully, but these errors were encountered: