Skip to content

Commit 89429a9

Browse files
authored
Merge pull request ReactTooltip#751 from Xubin-Hiretual/xubin/fix-aria-describedby
fix: set aria-describedby value wrong when custom id
2 parents 518745b + a04d26c commit 89429a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ class ReactTooltip extends React.Component {
411411

412412
// adding aria-describedby to target to make tooltips read by screen readers
413413
if (e && e.currentTarget && e.currentTarget.setAttribute) {
414-
e.currentTarget.setAttribute('aria-describedby', this.state.uuid);
414+
e.currentTarget.setAttribute(
415+
'aria-describedby',
416+
this.props.id || this.state.uuid
417+
);
415418
}
416419

417420
// Make sure the correct place is set

0 commit comments

Comments
 (0)