fix(hippy-react-web): event.path is not supported for safari

This commit is contained in:
shayxu
2021-11-24 18:38:51 +08:00
committed by zoomchan-cxj
parent c918740685
commit 9855ff92cc
@@ -148,7 +148,8 @@ export class Image extends React.Component {
isLoadSuccess: true,
});
if (onLoad) {
const imageInfo = e.path[0];
const path = e.path || (e.composedPath && e.composedPath());
const imageInfo = path[0];
onLoad({
width: imageInfo.naturalWidth,
height: imageInfo.naturalHeight,