Sfoglia il codice sorgente

fix Converting circular structure to JSON issue on some android devices

iou90 5 anni fa
parent
commit
8505010fce
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1
    1
      autoHeightWebView/index.js
  2. 1
    1
      autoHeightWebView/utils.js

+ 1
- 1
autoHeightWebView/index.js Vedi File

27
     width: getWidth(style)
27
     width: getWidth(style)
28
   }));
28
   }));
29
   const hanldeMessage = event => {
29
   const hanldeMessage = event => {
30
+    onMessage && onMessage(event);
30
     if (!event.nativeEvent) {
31
     if (!event.nativeEvent) {
31
       return;
32
       return;
32
     }
33
     }
45
         height,
46
         height,
46
         width
47
         width
47
       });
48
       });
48
-    onMessage && onMessage(event);
49
   };
49
   };
50
 
50
 
51
   const { currentSource, script } = useMemo(
51
   const { currentSource, script } = useMemo(

+ 1
- 1
autoHeightWebView/utils.js Vedi File

23
     clearInterval(updateSizeInterval)
23
     clearInterval(updateSizeInterval)
24
     height = ${element}.offsetHeight || window.innerHeight;
24
     height = ${element}.offsetHeight || window.innerHeight;
25
     width = ${element}.offsetWidth || window.innerWidth;
25
     width = ${element}.offsetWidth || window.innerWidth;
26
-    window.ReactNativeWebView.postMessage(JSON.stringify({ width: width, height: height, event: event }));
26
+    window.ReactNativeWebView.postMessage(JSON.stringify({ width: width, height: height }));
27
   }
27
   }
28
   `;
28
   `;
29
 
29