Repository navigation
Expose Empty's title as an ARIA heading via headingLevel - #1179
Open
sbansal-eightfold wants to merge 1 commit into
Open
sbansal-eightfold wants to merge 1 commit into
sbansal-eightfold wants to merge 1 commit into
Conversation
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.
SUMMARY:
Empty'stitlehas never been exposed to screen readers as a heading. The component has aheadingLevelprop, but it's documented@deprecated Unused propand was never wired into the render —titlealways renders as a plain<div>. This was flagged in a third-party accessibility audit (Eightfold Jira ENG-215077): a search/filter result page usingEmptyfor its "no results" state has no heading for a screen reader to navigate to.This wires up
headingLevelthe same wayDialog'sBaseDialogalready does it for its header: whenheadingLevelis set, the title div getsrole="heading"andaria-level. No heading role is applied whenheadingLevelis omitted, so this is fully backward compatible.JIRA TASK (Eightfold Employees Only):
https://eightfoldai.atlassian.net/browse/ENG-215077
CHANGE TYPE:
TEST COVERAGE:
TEST PLAN:
Empty.test.tsxmirroring the existingDialogheadingLevelcoverage: no heading attributes whenheadingLevelis undefined,role="heading"/aria-levelapplied when it's set, and no heading role added whentitleitself is absent.yarn jest src/components/Empty/Empty.test.tsx— all 9 tests pass (6 existing + 3 new).yarn typecheck— no new errors.