File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as ReactDOM from 'react-dom';
3
3
import cx from 'classnames' ;
4
4
import debounce = require( 'lodash/debounce' ) ;
5
5
import uniq = require( 'lodash/uniq' ) ;
6
+ import isEqual = require( 'lodash/isEqual' ) ;
6
7
import { getContextWrapper , Children } from '../utils' ;
7
8
8
9
const NO_SIZE_WRAPPER = 'no-size-wrapper' ;
@@ -259,7 +260,7 @@ export class Popover extends React.Component<Popover.Props, State> {
259
260
const { top : childY , left : childX } = this . getOffsetRect ( this . children ) ;
260
261
const { top : popoverY , left : popoverX } = this . getOffsetRect ( popoverNode ) ;
261
262
262
- this . setState ( {
263
+ const newState = {
263
264
child : {
264
265
width : childWidth ,
265
266
height : childHeight ,
@@ -272,7 +273,14 @@ export class Popover extends React.Component<Popover.Props, State> {
272
273
x : popoverX ,
273
274
y : popoverY
274
275
}
275
- } ) ;
276
+ } ;
277
+
278
+ if (
279
+ ! isEqual ( this . state . child , newState . child ) ||
280
+ ! isEqual ( this . state . popover , newState . popover )
281
+ ) {
282
+ this . setState ( newState ) ;
283
+ }
276
284
}
277
285
} ;
278
286
You can’t perform that action at this time.
0 commit comments