From c0514e27259d8d6cda6b7c4421f7d264ea606b13 Mon Sep 17 00:00:00 2001 From: mtvpls <247332661+mtvpls@users.noreply.github.com> Date: Mon, 3 Aug 2026 10:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BBvideocard=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/VideoCard.tsx | 10 ++-------- src/hooks/useLongPress.ts | 8 +++++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/VideoCard.tsx b/src/components/VideoCard.tsx index d98637e..51746e7 100644 --- a/src/components/VideoCard.tsx +++ b/src/components/VideoCard.tsx @@ -1046,10 +1046,6 @@ const VideoCard = forwardRef( onLoadingComplete={() => { setIsLoading(true); }} - onClick={(e) => { - e.stopPropagation(); - setShowImageViewer(true); - }} onError={(e) => { const img = e.currentTarget as HTMLImageElement; const doubanFallbackPoster = @@ -1094,8 +1090,7 @@ const VideoCard = forwardRef( WebkitUserSelect: 'none', userSelect: 'none', WebkitTouchCallout: 'none', - pointerEvents: 'auto', // 改为auto以响应点击事件 - cursor: 'pointer', // 添加指针样式 + pointerEvents: 'none', // 海报点击交给卡片外层处理,确保点击播放 } as React.CSSProperties } onContextMenu={(e) => { @@ -1162,8 +1157,7 @@ const VideoCard = forwardRef( ) : ( config.showPlayButton && (
{ - // 始终阻止默认行为,避免任何系统长按菜单 + // 只有本 hook 实际接管了触摸手势时才阻止浏览器默认 click。 + // 若 touchstart 命中 data-button 区域会提前 return,不应在 touchend 阶段 + // 再 preventDefault/stopPropagation,否则会吞掉外层卡片点击。 + if (!isActive.current) { + return; + } + e.preventDefault(); e.stopPropagation(); handleEnd();