Skip to content

Commit

Permalink
fix(dotcom-shell): accessibility issue with dotcom shell (#11114)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Closes #9036 

### Description

accessibility issue with dotcom shell. 
Most of the items listed  in the issue are no longer showing. 

### Changelog

**New**

- Added aria-label for Legal Navigation

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
sangeethababu9223 authored Feb 1, 2024
1 parent 877f5bb commit 10037b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
13 changes: 11 additions & 2 deletions packages/web-components/src/components/footer/footer-composite.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* 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 Down Expand Up @@ -126,6 +126,12 @@ class C4DFooterComposite extends MediaQueryMixin(
@property()
buttonLabel?: string;

/**
* The aria-label to use for the legal-nav
*/
@property()
navLabel?: string;

/**
* The clear button label for language selector.
*
Expand Down Expand Up @@ -356,6 +362,7 @@ class C4DFooterComposite extends MediaQueryMixin(
links,
legalLinks,
adjunctLinks,
navLabel,
} = this;
return html`
<c4d-footer
Expand Down Expand Up @@ -397,7 +404,9 @@ class C4DFooterComposite extends MediaQueryMixin(
? this.renderLanguageSelector()
: ``}
<c4d-legal-nav size="${ifDefined(size)}">
<c4d-legal-nav
size="${ifDefined(size)}"
navLabel="${ifDefined(navLabel)}">
<c4d-footer-logo size="${ifDefined(size)}"></c4d-footer-logo>
${legalLinks?.map(
({ title, url, titleEnglish }) => html`
Expand Down
14 changes: 11 additions & 3 deletions packages/web-components/src/components/footer/legal-nav.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* 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 @@ -10,6 +10,7 @@
import { LitElement, html } from 'lit';
import { property, query } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import settings from '../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings';
import { FOOTER_SIZE } from './footer';
import StableSelectorMixin from '../../globals/mixins/stable-selector';
Expand All @@ -30,7 +31,11 @@ class C4DLegalNav extends StableSelectorMixin(LitElement) {
*/
@property()
size = FOOTER_SIZE.REGULAR;

/**
* Navigation label for accessibility.
*/
@property()
navLabel = 'Legal Navigation';
/**
* The adjunct links container
*/
Expand Down Expand Up @@ -67,9 +72,12 @@ class C4DLegalNav extends StableSelectorMixin(LitElement) {
}

render() {
const { navLabel } = this;
return this.size !== FOOTER_SIZE.MICRO
? html`
<nav class="${c4dPrefix}--legal-nav">
<nav
class="${c4dPrefix}--legal-nav"
aria-label="${ifDefined(navLabel)}">
<div class="${this._getTypeClass()}">
<ul>
<slot></slot>
Expand Down

0 comments on commit 10037b4

Please sign in to comment.