From a04d26cc0639054b474ca8b373c95a09b199973a Mon Sep 17 00:00:00 2001 From: Xubin-Hiretual Date: Tue, 29 Mar 2022 17:12:57 +0800 Subject: [PATCH] fix: set aria-describedby value wrong when custom id --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9a4735bf7..96fb0f37e 100755 --- a/src/index.js +++ b/src/index.js @@ -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