Conversation
kirsty-hames
left a comment
There was a problem hiding this comment.
This works as expected thanks @swashbuck 👍 Testing with voiceOver on macOS
As a suggestion, aria-labelledby is typically used when there is visible text associated on a page. If there is no content that can be referenced to create an accessible name, the aria-label attribute should be used instead. Reference from MDN.
For example:
{{#if displayTitle}}aria-labelledby="{{_id}}-heading"{{else}}{{#if title}}aria-label="{{title}}"{{/if}}{{/if}}
Per PR review, when displayTitle is set the iframe now references the
visible component heading (#{_id}-heading) with aria-labelledby instead
of duplicating the string in aria-label. Falls back to aria-label with
the non-visible title field when displayTitle is empty.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks @kirsty-hames — agreed, and I've pushed a change to use Kept Posted via collaboration with Claude Code |
|
🎉 This PR is included in version 3.3.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes #22
Fix
aria-labelto the YouTube<iframe>, taken from the component'sdisplayTitle(falling back totitle).Notes
Previously the iframe had no author-set accessible name. The only name was a
titleattribute injected at runtime by the YouTube widget API, set to the video's own YouTube title, which authors cannot control or localise. The newaria-labeltakes precedence in the accessible name computation, so screen readers announce the component's title instead.Per the discussion on #22,
aria-labelis used rather thantitle(astitlebehaves inconsistently on iframes). This mirrors the approach already used in adapt-contrib-media (adaptlearning/adapt_framework#2822). Relevant WCAG success criterion: 4.1.2 Name, Role, Value (technique H64).The label is only emitted when
displayTitleortitleis set, so no emptyaria-label=""is produced.Testing
displayTitleset.<iframe>inside.youtube__widget.aria-labelmatching the component'sdisplayTitle.Posted via collaboration with Claude Code