Fix tooltip infinitely recursing (#9235)
parent
d1237b2c98
commit
3e8da6ffa4
|
@ -22,6 +22,7 @@ import ReactDOM from 'react-dom';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import UIStore from "../../../stores/UIStore";
|
import UIStore from "../../../stores/UIStore";
|
||||||
|
import { objectHasDiff } from "../../../utils/objects";
|
||||||
|
|
||||||
export enum Alignment {
|
export enum Alignment {
|
||||||
Natural, // Pick left or right
|
Natural, // Pick left or right
|
||||||
|
@ -91,9 +92,11 @@ export default class Tooltip extends React.PureComponent<ITooltipProps, State> {
|
||||||
this.updatePosition();
|
this.updatePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentDidUpdate() {
|
public componentDidUpdate(prevProps) {
|
||||||
|
if (objectHasDiff(prevProps, this.props)) {
|
||||||
this.updatePosition();
|
this.updatePosition();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the wrapper element, as the tooltip has finished using it
|
// Remove the wrapper element, as the tooltip has finished using it
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
|
Loading…
Reference in New Issue