Skip to content

Commit

Permalink
fix: set aria-describedby value wrong when custom id
Browse files Browse the repository at this point in the history
  • Loading branch information
Xubin-Hiretual committed Mar 29, 2022
1 parent 518745b commit a04d26c
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 a04d26c

Please sign in to comment.