Skip to content

Commit dd75317

Browse files
committed
Reset sensors always
Sensors need to be reset even if the element's size returned to its original dimensions.
1 parent cd5bda1 commit dd75317

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ResizeSensor.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,15 @@
174174

175175
var onResized = function() {
176176
// To prevent layout thrashing: first read from DOM ...
177-
if (!updateSize() || !element.resizedAttached) return;
177+
var updated = updateSize();
178+
179+
if (!element.resizedAttached) return;
178180

179181
/// ... then update.
180-
element.resizedAttached.call();
182+
if (updated) {
183+
element.resizedAttached.call();
184+
}
185+
181186
reset();
182187
};
183188

0 commit comments

Comments
 (0)