-
Notifications
You must be signed in to change notification settings - Fork 26
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: Make Panel heading optional #530
Conversation
Preview branch generated at https://panel-heading-optional.d1gko6en628vir.amplifyapp.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heading can't be optional, Panel uses a section meaning it's a region and it must have a label.
cauldron/packages/react/src/components/Panel/index.tsx
Lines 35 to 41 in 78d6a74
<section | |
aria-labelledby={headingId} | |
className={classNames('Panel', className, { | |
['Panel--collapsed']: collapsed | |
})} | |
{...other} | |
> |
For context, why is a heading not needed here?
@scurker It is for the User Management Table, which does not have a Panel level heading. Can we have a label without a visible heading for the Panel? Like when heading is not there, we require a label. |
Is Manage Users not a heading in this instance? We can't make this change alone to make the heading optional because that would introduce an A11Y issue where the section has an invalid If we want panel's heading to be optional, there's a couple of options
OR
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small nitpicks, and we need some tests to check for the conditional rendering of the heading.
It would also be nice to update docs.
Preview branch generated at https://panel-heading-optional.d1gko6en628vir.amplifyapp.com |
Needed in https://github.com/dequelabs/walnut/issues/2665