Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Fix tooltip a11y issue (#2065)
Browse files Browse the repository at this point in the history
  • Loading branch information
icemanlily authored and tw15egan committed Mar 20, 2019
1 parent 4b7143c commit 2c33ca3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ class Tooltip extends Component {
'aria-owns': tooltipId,
};

const ariaDescribedbyProps = !open
? {}
: {
'aria-describedby': tooltipId,
};
const finalIcon = IconCustomElement ? (
<IconCustomElement
name={iconName}
Expand Down Expand Up @@ -489,6 +494,7 @@ class Tooltip extends Component {
aria-haspopup="true"
aria-label={iconDescription}
aria-expanded={open}
{...ariaDescribedbyProps}
{...ariaOwnsProps}>
{finalIcon}
</div>
Expand All @@ -510,6 +516,7 @@ class Tooltip extends Component {
onBlur={this.handleMouse}
aria-haspopup="true"
aria-expanded={open}
{...ariaDescribedbyProps}
{...ariaOwnsProps}>
{triggerText}
</div>
Expand Down

0 comments on commit 2c33ca3

Please sign in to comment.