Skip to content

Commit 1301014

Browse files
kingyue737Justineo
authored andcommitted
fix: not auto-resize when the container size is 0, closes #831
1 parent b7852ab commit 1301014

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/composables/autoresize.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export function useAutoresize(
4040
return;
4141
}
4242
}
43+
44+
// Skip if container has zero size
45+
if (root.offsetWidth === 0 || root.offsetHeight === 0) {
46+
return;
47+
}
48+
4349
resizeCallback();
4450
});
4551
ro.observe(root);

0 commit comments

Comments
 (0)