From 83bca9d28774574428b2171b88d4df60b22b5daa Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 17 Apr 2023 15:57:29 +0700 Subject: [PATCH 1/2] fix regression of console error --- src/components/Tooltip/TooltipRenderedOnPageBody.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Tooltip/TooltipRenderedOnPageBody.js b/src/components/Tooltip/TooltipRenderedOnPageBody.js index 43bf5f49cead..a837cf0fecff 100644 --- a/src/components/Tooltip/TooltipRenderedOnPageBody.js +++ b/src/components/Tooltip/TooltipRenderedOnPageBody.js @@ -86,6 +86,12 @@ class TooltipRenderedOnPageBody extends React.PureComponent { } componentDidUpdate(prevProps) { + // We need to re-calculate the tooltipContentWidth if it is greater than maxWidth. + // So that the wrapperWidth still be updated again with correct value + if (this.state.tooltipContentWidth > prevProps.maxWidth) { + this.updateTooltipContentWidth(); + } + if (prevProps.text === this.props.text && prevProps.renderTooltipContent === this.props.renderTooltipContent) { return; } @@ -118,11 +124,7 @@ class TooltipRenderedOnPageBody extends React.PureComponent { } render() { - // We need to re-calculate the tooltipContentWidth if it is greater than maxWidth. - // So that the wrapperWidth still be updated again with correct value - if (this.state.tooltipContentWidth > this.props.maxWidth) { - this.updateTooltipContentWidth(); - } + const { animationStyle, tooltipWrapperStyle, From 57388640eb97255c0089c4c316d13747b6a1dd34 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 17 Apr 2023 16:10:51 +0700 Subject: [PATCH 2/2] format code --- src/components/Tooltip/TooltipRenderedOnPageBody.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Tooltip/TooltipRenderedOnPageBody.js b/src/components/Tooltip/TooltipRenderedOnPageBody.js index a837cf0fecff..13af49751c57 100644 --- a/src/components/Tooltip/TooltipRenderedOnPageBody.js +++ b/src/components/Tooltip/TooltipRenderedOnPageBody.js @@ -124,7 +124,6 @@ class TooltipRenderedOnPageBody extends React.PureComponent { } render() { - const { animationStyle, tooltipWrapperStyle,