Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Regression of console error #17494

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/Tooltip/TooltipRenderedOnPageBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down