Don't skip the resize if newWidth or newHeight is < 1 (#12002)

With full screen panel mode, the width and height can be updated to 0
(because the panel is hidden).  If _size isn’t updated, the second time
through it’ll skip the resize because of the if (newWidth ===
this._size[0] && newHeight === this._size[1])

Another option to fix this is to get rid of that check, and continue to
do the resize when the _size values are equal.  I felt this one was
slightly better, but could go either way.
This commit is contained in:
Stacey Gammon 2017-05-26 11:10:20 -04:00 committed by GitHub
parent ee1178f2e4
commit b8b597338e

View file

@ -76,9 +76,7 @@ class TagCloud extends EventEmitter {
resize() {
const newWidth = this._element.offsetWidth;
const newHeight = this._element.offsetHeight;
if (newWidth < 1 || newHeight < 1) {
return;
}
if (newWidth === this._size[0] && newHeight === this._size[1]) {
return;
}