Explorar o código

修复无法找到node报错的问题

liumingyi_1 %!s(int64=5) %!d(string=hai) anos
pai
achega
22bd6dbb2b
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      package.json
  2. 1 1
      src/components/VisibleAnimationHandle.tsx

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "react-photo-view",
-  "version": "0.3.2",
+  "version": "0.3.4",
   "description": "React photo preview.",
   "author": "MinJieLiu",
   "license": "MIT",

+ 1 - 1
src/components/VisibleAnimationHandle.tsx

@@ -42,7 +42,7 @@ export default function VisibleAnimationHandle({
       return;
     }
     const originRef = currentImage.originRef;
-    if (originRef) {
+    if (originRef && originRef.nodeType === 1) {
       // 获取触发时节点位置
       const { top, left, width, height } = originRef.getBoundingClientRect();
       updateOriginRect({