From d14339b59d5d25f5ce809c80b8a22585417d5311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Sun, 25 Mar 2018 01:18:54 +0100 Subject: [PATCH] Bail out from calculating dimenions for detached nodes --- src/calculateNodeHeight.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calculateNodeHeight.js b/src/calculateNodeHeight.js index eb804080..4c08ea35 100644 --- a/src/calculateNodeHeight.js +++ b/src/calculateNodeHeight.js @@ -131,6 +131,11 @@ function calculateNodeStyling(node, uid, useCache = false) { const boxSizing = sizingStyle['box-sizing']; + // probably node is detached from DOM, can't read computed dimensions + if (boxSizing === '') { + return null; + } + // IE (Edge has already correct behaviour) returns content width as computed width // so we need to add manually padding and border widths if (isIE && boxSizing === 'border-box') {