Skip to content

Commit a04d26c

Browse files
fix: set aria-describedby value wrong when custom id
1 parent 518745b commit a04d26c

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)