From ffe32330a1bb7dbefa5c1f391880bb668e5ec7c9 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 6 Aug 2026 17:35:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91hove?= =?UTF-8?q?r=E6=92=AD=E6=94=BE=E7=9A=84DOM=E5=BC=95=E7=94=A8=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=80=A7=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加document.body.contains检查,确保操作仍在DOM中的视频元素 --- .../generate/components/material/ManualMaterialList.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/generate/components/material/ManualMaterialList.tsx b/apps/web/src/pages/generate/components/material/ManualMaterialList.tsx index faafc7518..a067e1098 100644 --- a/apps/web/src/pages/generate/components/material/ManualMaterialList.tsx +++ b/apps/web/src/pages/generate/components/material/ManualMaterialList.tsx @@ -25,8 +25,12 @@ const ManualMaterialList: React.FC = ({ const handleVideoMouseEnter = useCallback((e: React.MouseEvent) => { const video = e.currentTarget - // 暂停之前正在播放的视频 - if (activeVideoRef.current && activeVideoRef.current !== video) { + // 暂停之前正在播放的视频(检查是否仍在 DOM 中) + if ( + activeVideoRef.current && + activeVideoRef.current !== video && + document.body.contains(activeVideoRef.current) + ) { activeVideoRef.current.pause() activeVideoRef.current.currentTime = 0 }