iou90 5 years ago
parent
commit
6a2defdf53
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      autoHeightWebView/utils.js

+ 3
- 3
autoHeightWebView/utils.js View File

21
       return;
21
       return;
22
     }
22
     }
23
     clearInterval(updateSizeInterval)
23
     clearInterval(updateSizeInterval)
24
-    height = ${element}.offsetHeight || window.innerHeight;
25
-    width = ${element}.offsetWidth || window.innerWidth;
24
+    height = ${element}.offsetHeight || document.documentElement.offsetHeight;
25
+    width = ${element}.offsetWidth || document.documentElement.offsetWidth;
26
     window.ReactNativeWebView.postMessage(JSON.stringify({ width: width, height: height }));
26
     window.ReactNativeWebView.postMessage(JSON.stringify({ width: width, height: height }));
27
   }
27
   }
28
   `;
28
   `;
52
   window.addEventListener('load', updateSize);
52
   window.addEventListener('load', updateSize);
53
   window.addEventListener('resize', updateSize);
53
   window.addEventListener('resize', updateSize);
54
   ${domMutationObserveScript}
54
   ${domMutationObserveScript}
55
-  ${Platform.OS === 'ios' ? makeScalePageToFit(zoomable) : ''}
55
+  ${makeScalePageToFit(zoomable)}
56
   updateSize();
56
   updateSize();
57
   `;
57
   `;
58
 
58