Skip to content

Commit

Permalink
ADA-1572 - Replace a tag with span when link is missing (#922)
Browse files Browse the repository at this point in the history
### Description of the Changes
When the link is not provided the anchor tag is replaced with a span tag

**Issue:**
The SR was announcing logo as link even when no link was provided
**Fix:**
  • Loading branch information
valentinStoicaK authored Aug 27, 2024
1 parent ed64ed8 commit 9760449
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class Logo extends Component<any, any> {
<div
className={[style.controlButtonContainer, !props.config.url || !this.state.isUrlClickable ? style.emptyUrl : ''].join(' ')}
title={props.config.text}>
{this.state.isUrlClickable ? (
<a
onClick={this._handleOnClick}
onKeyDown={this._handleKeyDown}
Expand All @@ -143,6 +144,14 @@ class Logo extends Component<any, any> {
>
<img className={style.icon} src={props.config.img} />
</a>
) : (
<span
className={style.controlButton}
aria-label={props.config.text || props.logoText}
>
<img className={style.icon} src={props.config.img} />
</span>
)}
</div>
);
}
Expand Down

0 comments on commit 9760449

Please sign in to comment.