Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3e8da6f

Browse files
authored
Fix tooltip infinitely recursing (#9235)
1 parent d1237b2 commit 3e8da6f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/views/elements/Tooltip.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import ReactDOM from 'react-dom';
2222
import classNames from 'classnames';
2323

2424
import UIStore from "../../../stores/UIStore";
25+
import { objectHasDiff } from "../../../utils/objects";
2526

2627
export enum Alignment {
2728
Natural, // Pick left or right
@@ -91,8 +92,10 @@ export default class Tooltip extends React.PureComponent<ITooltipProps, State> {
9192
this.updatePosition();
9293
}
9394

94-
public componentDidUpdate() {
95-
this.updatePosition();
95+
public componentDidUpdate(prevProps) {
96+
if (objectHasDiff(prevProps, this.props)) {
97+
this.updatePosition();
98+
}
9699
}
97100

98101
// Remove the wrapper element, as the tooltip has finished using it

0 commit comments

Comments
 (0)