We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf6a73f commit 9a0e551Copy full SHA for 9a0e551
src/AutoSizer.tsx
@@ -155,8 +155,8 @@ const AutoSizer = ({
155
const paddingBottom = parseInt(style.paddingBottom) || 0;
156
157
// find new dimensions
158
- const newHeight = (parent.offsetHeight || 0) - paddingTop - paddingBottom;
159
- const newWidth = (parent.offsetWidth || 0) - paddingLeft - paddingRight;
+ const newHeight = Math.max((parent.offsetHeight || 0) - paddingTop - paddingBottom, 0);
+ const newWidth = Math.max((parent.offsetWidth || 0) - paddingLeft - paddingRight, 0);
160
161
// update state
162
if (newHeight !== containerHeight || newWidth !== containerWidth) {
0 commit comments