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(link-list-section): replaced wrong heading component in storybook #4922

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020
* Copyright IBM Corp. 2020, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -23,6 +23,16 @@ class DDSContentSectionHeading extends LitElement {
@property({ reflect: true })
slot = 'heading';

connectedCallback() {
if (!this.hasAttribute('role')) {
this.setAttribute('role', 'heading');
}
Comment on lines +27 to +29
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add aria-level, too? Here's an example for one representing <h3>.

if (!this.hasAttribute('aria-level')) {
this.setAttribute('aria-level', '3');
}
super.connectedCallback();
}

render() {
return html`
<slot></slot>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020
* Copyright IBM Corp. 2020, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -20,7 +20,7 @@ export const Default = ({ parameters }) => {
const { heading } = parameters?.props?.LinkListSection ?? {};
return html`
<dds-link-list-section>
<dds-content-section-heading>${heading}</dds-content-section-heading>
<dds-link-list-heading>${heading}</dds-link-list-heading>
<dds-link-list>
<dds-link-list-item href="https://example.com">
Learn more about Kubernetes ${ArrowRight20({ slot: 'icon' })}
Expand Down