Skip to content

Commit

Permalink
Merge pull request #751 from Xubin-Hiretual/xubin/fix-aria-describedby
Browse files Browse the repository at this point in the history
fix: set aria-describedby value wrong when custom id
  • Loading branch information
aronhelser committed Mar 29, 2022
2 parents 518745b + a04d26c commit 89429a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ class ReactTooltip extends React.Component {

// adding aria-describedby to target to make tooltips read by screen readers
if (e && e.currentTarget && e.currentTarget.setAttribute) {
e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
e.currentTarget.setAttribute(
'aria-describedby',
this.props.id || this.state.uuid
);
}

// Make sure the correct place is set
Expand Down

0 comments on commit 89429a9

Please sign in to comment.