Skip to content
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

fix(block): add accessible label for slotted controls #9502

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

driskull
Copy link
Member

@driskull driskull commented Jun 3, 2024

Related Issue: #8037

Summary

  • Add aria-labelledby to internal control container for enhanced accessibility.

@driskull
Copy link
Member Author

driskull commented Jun 3, 2024

@geospatialem could you help test this out?

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Jun 3, 2024
Copy link
Member

@geospatialem geospatialem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like JAWS only seems to be supported with aria-labelledby in this case, but NVDA does not provide support.

In some initial sleuthing, it seems like there may be a support issue with NVDA and the shadow DOM with aria-named attributes similar to what is outline in this post.

I'm not sure the best path forward, as it seems browsers and AT is still catching up to support with shadow DOM. Maybe we just account for JAWS here, and mention NVDA is out of scope? Otherwise there are some hacky loop holes, maybe using a live region? WDYT?

  1. Use an ARIA live region instead of IDREFs. (This is the same technique used by canvas-based applications, such as Google Docs.) This option is pretty heavy-handed, but I suppose you could use it as a last resort.

@driskull
Copy link
Member Author

driskull commented Jun 4, 2024

I'm not sure the best path forward, as it seems browsers and AT is still catching up to support with shadow DOM. Maybe we just account for JAWS here, and mention NVDA is out of scope? Otherwise there are some hacky loop holes, maybe using a live region? WDYT?

Yeah we might want to mention NVDA is out of scope until it catches up with shadow dom. The next best option would be aria-live but I don't think thats a great solution.

Co-authored-by: Kitty Hurley <khurley@esri.com>
@driskull driskull changed the title fix(block): add aria-describedby for slotted controls. fix(block): add accessible label for slotted controls Jun 4, 2024
@driskull driskull marked this pull request as ready for review June 4, 2024 16:50
@driskull driskull requested a review from a team as a code owner June 4, 2024 16:50
@driskull driskull added the skip visual snapshots Pull requests that do not need visual regression testing. label Jun 4, 2024
@@ -370,7 +370,7 @@ export class Block
headerContent
)}
{hasControl ? (
<div class={CSS.controlContainer}>
<div aria-labelledby={IDS.header} class={CSS.controlContainer}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the control actually labeled by the entire header? When I run this through VO it works but UX wise I'm not 100% sure it makes sense. The entire header includes icons, heading, and description. That's potentially a lot of content to label a control.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its just the title and icon.

const headerContent = (
<header class={CSS.header} id={IDS.header}>
{this.renderIcon()}
{this.renderTitle()}
</header>
);

Copy link
Member

@geospatialem geospatialem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

Before merging, does the PR summary scope need to be updated to fit the label over description?

@driskull driskull merged commit a9054d5 into main Jun 6, 2024
13 checks passed
@driskull driskull deleted the dris0000/block-8037 branch June 6, 2024 22:49
@github-actions github-actions bot added this to the 2024-06-25 - Jun Release milestone Jun 6, 2024
benelan added a commit that referenced this pull request Jun 10, 2024
…orkflow

* origin/main: (26 commits)
  revert: refactor: add simpler `componentFocusable` util (deprecates `LoadableComponent`) (#9515)
  chore(linting): enable selector-pseudo-element-colon-notation rule (#9518)
  refactor(storybook): refactor tooltip simple story interface (#9538)
  refactor(dom): consolidate transition/animation waiting utils (#9341)
  refactor(storybook): build storybook simple story args interfaces using component class (#9457)
  chore: release next
  fix(block): add accessible label for slotted controls (#9502)
  feat(action-bar, action-pad): add expandLabel and collapseLabel to messages (#9497)
  chore: release next
  feat(action-menu, combobox, dropdown, input-date-picker, popover): allow logical placements for flipPlacements property. #8825 (#9490)
  fix(popover): correct border radius on close button (#9485)
  fix(list-item): hide nested list items by default (#9474)
  refactor: move component types into component specific interfaces files (#9527)
  chore: release next
  fix(alert): pause auto-close alert when link focused (#9503)
  refactor(storybook): consolidate storybook and component types (#9500)
  refactor(calcite-block-section,calcite-card): consolidate interfaces imports (#9517)
  chore: release next
  fix(block-section): restore block toggling when clicking on the header switch (#9472)
  chore: release next
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants