fix: not auto-resize when the container size is 0, closes #831

This commit is contained in:
Yue JIN
2025-05-23 12:39:40 +08:00
committed by GU Yiling
parent b7852ab643
commit 1301014626

View File

@ -40,6 +40,12 @@ export function useAutoresize(
return; return;
} }
} }
// Skip if container has zero size
if (root.offsetWidth === 0 || root.offsetHeight === 0) {
return;
}
resizeCallback(); resizeCallback();
}); });
ro.observe(root); ro.observe(root);