Jelajahi Sumber

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

liumingyi_1 5 tahun lalu
induk
melakukan
22bd6dbb2b
2 mengubah file dengan 2 tambahan dan 2 penghapusan
  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({