diff --git a/packages/web-components/src/components/content-section/content-section-heading.ts b/packages/web-components/src/components/content-section/content-section-heading.ts index 5bf8dfd904e..a45c5fde572 100644 --- a/packages/web-components/src/components/content-section/content-section-heading.ts +++ b/packages/web-components/src/components/content-section/content-section-heading.ts @@ -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. @@ -23,6 +23,16 @@ class DDSContentSectionHeading extends LitElement { @property({ reflect: true }) slot = 'heading'; + connectedCallback() { + if (!this.hasAttribute('role')) { + this.setAttribute('role', 'heading'); + } + if (!this.hasAttribute('aria-level')) { + this.setAttribute('aria-level', '3'); + } + super.connectedCallback(); + } + render() { return html` diff --git a/packages/web-components/src/components/link-list-section/__stories__/link-list-section.stories.ts b/packages/web-components/src/components/link-list-section/__stories__/link-list-section.stories.ts index abe7857dd92..0576724c135 100644 --- a/packages/web-components/src/components/link-list-section/__stories__/link-list-section.stories.ts +++ b/packages/web-components/src/components/link-list-section/__stories__/link-list-section.stories.ts @@ -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. @@ -20,7 +20,7 @@ export const Default = ({ parameters }) => { const { heading } = parameters?.props?.LinkListSection ?? {}; return html` - ${heading} + ${heading} Learn more about Kubernetes ${ArrowRight20({ slot: 'icon' })}