Skip to content

Commit 0f5d445

Browse files
committed
Avoid onWindowResize() being called twice in quick succession for no reason
See wnr/element-resize-detector#110 about callOnAdd. Without callOnAdd: false, onWindowResize() is called immediately after: this.erd.listenTo(self.$refs.item, function () { bla bla });
1 parent d3574b1 commit 0f5d445

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/GridLayout.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@
165165
self.updateHeight();
166166
self.$nextTick(function () {
167167
this.erd = elementResizeDetectorMaker({
168-
strategy: "scroll" //<- For ultra performance.
168+
strategy: "scroll", //<- For ultra performance.
169+
// See https://github.com/wnr/element-resize-detector/issues/110 about callOnAdd.
170+
callOnAdd: false,
169171
});
170172
this.erd.listenTo(self.$refs.item, function () {
171173
self.onWindowResize();

0 commit comments

Comments
 (0)