a11y(2.4.6): guard DrawerContent against empty <h2> when title is omitted#3595
Open
rosanusi wants to merge 1 commit into
Open
a11y(2.4.6): guard DrawerContent against empty <h2> when title is omitted#3595rosanusi wants to merge 1 commit into
rosanusi wants to merge 1 commit into
Conversation
…tted
DrawerContent always rendered <h2>{title}</h2> even when title was '' (the
default), producing an empty heading that fails WCAG 2.4.6 (Headings and
Labels, AA) and 4.1.2 (Name, Role, Value).
Wrap the title-wrapper div in {#if title || $$slots['subtitle']} and the <h2>
in {#if title} so the element is only emitted when content exists. The
subtitle slot continues to render independently. Consumers that pass title=
are unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Accessibility triageUnknown slugs in manifest:
Either the slug is misspelled, or the entry has not been authored yet. Audit team: add the entry to See DT-4048 for the triage system design. |
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
DrawerContentdefaultedtitleto''and unconditionally rendered<h2>{title}</h2>. When a consumer omitted the prop (two cloud consumers do), the DOM contained an empty heading — no accessible name, failing WCAG 2.4.6 (Headings and Labels, AA) and 4.1.2 (Name, Role, Value).Fix: wrap the
title-wrapperdiv in{#if title || $$slots['subtitle']}and the<h2>in{#if title}. The element is only emitted when content exists; the subtitle slot continues to render independently.What changes
Impact
title=(all 9 existing correct usages): no change in rendered output.title(the two cloud gaps): empty<h2>removed.Test plan
<h2>still renders with correct text.<h2>.References
audit-output/issues/2.4.6-cloud-drawer-content-empty-title.mdA11y-Audit-Ref: 2.4.6-cloud-drawer-content-empty-title
🤖 Generated with Claude Code