ROX-25632: Fix accessibility issues for empty table header#12300
Merged
pedrottimark merged 2 commits intomasterfrom Aug 9, 2024
Merged
ROX-25632: Fix accessibility issues for empty table header#12300pedrottimark merged 2 commits intomasterfrom
pedrottimark merged 2 commits intomasterfrom
Conversation
Contributor
|
Images are ready for the commit at 291b0fc. To use with deploy scripts, first |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12300 +/- ##
==========================================
- Coverage 48.26% 48.26% -0.01%
==========================================
Files 2402 2402
Lines 171563 171563
==========================================
- Hits 82809 82801 -8
- Misses 82066 82073 +7
- Partials 6688 6689 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dvail
approved these changes
Aug 9, 2024
Contributor
dvail
left a comment
There was a problem hiding this comment.
Looks great, thank you Mark!
9fa8d05 to
291b0fc
Compare
shireenf-ibm
pushed a commit
to shireenf-ibm/stackrox
that referenced
this pull request
Aug 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Apply 80/20 principle to fix generic issues so team members can divide and conquer pages that have specific issues.
Problem
https://dequeuniversity.com/rules/axe/4.9/empty-table-header
Analysis
Thank you David for observing
<Th screenReaderText="Row expansion" />in PatternFly example code that renders:https://www.patternfly.org/components/table#expandable
patternfly/patternfly-react#10152
Until upgrade to PatternFly 5.3 in which
Thelement hasscreenReaderTextprop, temporary solution is to render thespanelement as a child:Here are the most common situations:
Solution
Tdin table head withThelement that has temporary child (pending futurescreenReaderTextprop).aria-labelinThelement with temporary child (pending futurescreenReaderTextprop).screenReaderTextprop) toThthat does not have children, norexpandorselectprops (for which PatternFly renders children).eslint-plugin-whateverpackage name andpluginWhatevername in eslint.config.js file.jsx-a11yrules because its rules are based on HTML not PatternFly elements.Residue
ExpandRowThelement?eslint-plugin-jsx-a11ypackage fromdevDependenciesafter we replace yarn with npm.User-facing documentation
Testing and quality
Automated testing
How I validated my change
yarn lintin uiyarn buildin ui and then compute branch - master for the followingwc build/static/js/*.jsmain.js 0 = 4617863 - 4617863
total 2114 = 11688528 - 11686414
ls -al build/static/js/*.js | wcfiles 0 = 174 - 174
yarn startin uiManual testing
Visit /main/listening-endpoints and see that

expandprop ofThelement renders a child.Visit /main/integrations/imageIntegrations/docker
Before changes, see

tdelement at the right of table head.After changes, see

thelement at the right of table head.Visit /main/access-control/permission-sets
Before changes, see

thelement witharia-labelprop and presence of accessibility issue.After changes, see

thelement with temporaryspanand absence of accessibility issue.Visit /main/access-control/roles?action=create
Before changes, see empty

thelement and presence of accessibility issue.After changes, see

thelement with temporaryspanand absence of accessibility issue.Integration testing