iou90 5 年之前
父節點
當前提交
6a2defdf53
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      autoHeightWebView/utils.js

+ 3
- 3
autoHeightWebView/utils.js 查看文件

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