From 33ac37ea790bdc06b39a679e8a6271a08b7127c6 Mon Sep 17 00:00:00 2001 From: John Kaeser Date: Wed, 2 Feb 2022 16:04:36 -0500 Subject: [PATCH 1/3] fix(feature-section-card-link): remove incorrect role (#8010) --- .../feature-section/feature-section-card-link.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/web-components/src/components/feature-section/feature-section-card-link.ts b/packages/web-components/src/components/feature-section/feature-section-card-link.ts index 4918b1573c0..3ec0f9e0bfc 100644 --- a/packages/web-components/src/components/feature-section/feature-section-card-link.ts +++ b/packages/web-components/src/components/feature-section/feature-section-card-link.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2020, 2021 + * Copyright IBM Corp. 2020, 2022 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -21,13 +21,6 @@ const { stablePrefix: ddsPrefix } = ddsSettings; */ @customElement(`${ddsPrefix}-feature-section-card-link`) class DDSFeatureSectionCardLink extends DDSCardCTA { - connectedCallback() { - if (!this.hasAttribute('role')) { - this.setAttribute('role', 'listitem'); - } - super.connectedCallback(); - } - static get stableSelector() { return `${ddsPrefix}--feature-section-card-link`; } From d96a545a0353712d52cc7628e16c28d252fe25d3 Mon Sep 17 00:00:00 2001 From: John Kaeser Date: Wed, 2 Feb 2022 16:05:07 -0500 Subject: [PATCH 2/3] fix(link-list): add correct role (#8010) --- .../web-components/src/components/link-list/link-list.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/web-components/src/components/link-list/link-list.ts b/packages/web-components/src/components/link-list/link-list.ts index d8241985497..972b9d6c4de 100644 --- a/packages/web-components/src/components/link-list/link-list.ts +++ b/packages/web-components/src/components/link-list/link-list.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2020, 2021 + * Copyright IBM Corp. 2020, 2022 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -91,6 +91,13 @@ class DDSLinkList extends StableSelectorMixin(LitElement) { @property({ reflect: true }) type = LINK_LIST_TYPE.DEFAULT; + connectedCallback() { + if (!this.hasAttribute('role')) { + this.setAttribute('role', 'list'); + } + super.connectedCallback(); + } + render() { const { type, _endTypeLayout: endTypeLayout } = this; const headingClasses = classMap({ From 7f34f514e555f25388976cf4d61a17f888f26f1d Mon Sep 17 00:00:00 2001 From: John Kaeser Date: Thu, 3 Feb 2022 13:18:14 -0500 Subject: [PATCH 3/3] fix(top-nav-item): remove orhpaned listitem role (#8010) --- .../web-components/src/components/masthead/top-nav-item.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/web-components/src/components/masthead/top-nav-item.ts b/packages/web-components/src/components/masthead/top-nav-item.ts index 74d6cd91d7d..e7843fcdcbc 100644 --- a/packages/web-components/src/components/masthead/top-nav-item.ts +++ b/packages/web-components/src/components/masthead/top-nav-item.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2020, 2021 + * Copyright IBM Corp. 2020, 2022 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -45,6 +45,10 @@ class DDSTopNavItem extends BXHeaderNavItem { firstUpdated() { this.shadowRoot?.querySelectorAll('[role="menuitem"]').forEach(menuItem => menuItem.removeAttribute('role')); + + if (this.hasAttribute('role') && this.getAttribute('role') === 'listitem') { + this.removeAttribute('role'); + } } static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader