From 9855ff92ccda25d22be33d3e1b56eadd4a8b9bdf Mon Sep 17 00:00:00 2001 From: shayxu Date: Wed, 17 Nov 2021 16:09:24 +0800 Subject: [PATCH] fix(hippy-react-web): event.path is not supported for safari --- packages/hippy-react-web/src/components/image.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hippy-react-web/src/components/image.tsx b/packages/hippy-react-web/src/components/image.tsx index dc24b7451..c2a7557c7 100644 --- a/packages/hippy-react-web/src/components/image.tsx +++ b/packages/hippy-react-web/src/components/image.tsx @@ -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,