mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 03:05:51 +03:00
Fix tooltip infinitely recursing (#9235)
This commit is contained in:
parent
d1237b2c98
commit
3e8da6ffa4
1 changed files with 5 additions and 2 deletions
|
@ -22,6 +22,7 @@ import ReactDOM from 'react-dom';
|
|||
import classNames from 'classnames';
|
||||
|
||||
import UIStore from "../../../stores/UIStore";
|
||||
import { objectHasDiff } from "../../../utils/objects";
|
||||
|
||||
export enum Alignment {
|
||||
Natural, // Pick left or right
|
||||
|
@ -91,8 +92,10 @@ export default class Tooltip extends React.PureComponent<ITooltipProps, State> {
|
|||
this.updatePosition();
|
||||
}
|
||||
|
||||
public componentDidUpdate() {
|
||||
this.updatePosition();
|
||||
public componentDidUpdate(prevProps) {
|
||||
if (objectHasDiff(prevProps, this.props)) {
|
||||
this.updatePosition();
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the wrapper element, as the tooltip has finished using it
|
||||
|
|
Loading…
Reference in a new issue