diff --git a/src/components/Tooltip/TooltipRenderedOnPageBody.js b/src/components/Tooltip/TooltipRenderedOnPageBody.js index 43bf5f49cead..13af49751c57 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,6 @@ 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,