From 3ed129afb24112a754d2f78b73bd84fd1f7c4d67 Mon Sep 17 00:00:00 2001 From: hzm <934585316@qq.com> Date: Mon, 9 Mar 2026 17:23:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PC=E7=AB=AF=E8=A1=A8=E5=A4=B4=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=B8=B2=E6=9F=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/MobileFundTable.jsx | 10 ++++++++-- app/components/PcFundTable.jsx | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/components/MobileFundTable.jsx b/app/components/MobileFundTable.jsx index 7a718a1..f4ce408 100644 --- a/app/components/MobileFundTable.jsx +++ b/app/components/MobileFundTable.jsx @@ -354,13 +354,19 @@ export default function MobileFundTable({ const nextStickyTop = getEffectiveStickyTop(); setEffectiveStickyTop((prev) => (prev === nextStickyTop ? prev : nextStickyTop)); - const tableRect = tableContainerRef.current?.getBoundingClientRect(); + const tableEl = tableContainerRef.current; + const tableRect = tableEl?.getBoundingClientRect(); if (!tableRect) { setShowPortalHeader(window.scrollY >= nextStickyTop); return; } - setShowPortalHeader(tableRect.top <= nextStickyTop); + const headerEl = tableEl?.querySelector('.table-header-row'); + const headerHeight = headerEl?.getBoundingClientRect?.().height ?? 0; + const hasPassedHeader = (tableRect.top + headerHeight) <= nextStickyTop; + const hasTableInView = tableRect.bottom > nextStickyTop; + + setShowPortalHeader(hasPassedHeader && hasTableInView); }; const throttledVerticalUpdate = throttle(updateVerticalState, 1000/60, { leading: true, trailing: true }); diff --git a/app/components/PcFundTable.jsx b/app/components/PcFundTable.jsx index 3f3b826..c4884ab 100644 --- a/app/components/PcFundTable.jsx +++ b/app/components/PcFundTable.jsx @@ -412,7 +412,12 @@ export default function PcFundTable({ return; } - setShowPortalHeader(rect.top <= nextStickyTop); + const headerEl = tableEl?.querySelector('.table-header-row'); + const headerHeight = headerEl?.getBoundingClientRect?.().height ?? 0; + const hasPassedHeader = (rect.top + headerHeight) <= nextStickyTop; + const hasTableInView = rect.bottom > nextStickyTop; + + setShowPortalHeader(hasPassedHeader && hasTableInView); setPortalHorizontal((prev) => { const next = {