fix: 移动端表头吸附改进

This commit is contained in:
hzm
2026-03-08 12:35:06 +08:00
parent 6d2cf60d21
commit a3719c58fb
2 changed files with 8 additions and 10 deletions

View File

@@ -263,9 +263,9 @@ export default function MobileFundTable({
group.mobileShowFullFundName = show; group.mobileShowFullFundName = show;
parsed[groupKey] = group; parsed[groupKey] = group;
window.localStorage.setItem('customSettings', JSON.stringify(parsed)); window.localStorage.setItem('customSettings', JSON.stringify(parsed));
setConfigByGroup((prev) => ({ setConfigByGroup((prev) => ({
...prev, ...prev,
[groupKey]: { ...prev[groupKey], mobileShowFullFundName: show } [groupKey]: { ...prev[groupKey], mobileShowFullFundName: show }
})); }));
onCustomSettingsChange?.(); onCustomSettingsChange?.();
} catch {} } catch {}
@@ -338,11 +338,9 @@ export default function MobileFundTable({
const handlePortalScroll = () => syncScrollToTable(); const handlePortalScroll = () => syncScrollToTable();
tableEl.addEventListener('scroll', handleTableScroll, { passive: true }); tableEl.addEventListener('scroll', handleTableScroll, { passive: true });
portalEl.addEventListener('scroll', handlePortalScroll, { passive: true });
return () => { return () => {
tableEl.removeEventListener('scroll', handleTableScroll); tableEl.removeEventListener('scroll', handleTableScroll);
portalEl.removeEventListener('scroll', handlePortalScroll);
}; };
}, [showPortalHeader]); }, [showPortalHeader]);
@@ -430,8 +428,8 @@ export default function MobileFundTable({
</button> </button>
)} )}
<div className="title-text"> <div className="title-text">
<span <span
className={`name-text ${showFullFundName ? 'show-full' : ''}`} className={`name-text ${showFullFundName ? 'show-full' : ''}`}
title={isUpdated ? '今日净值已更新' : ''} title={isUpdated ? '今日净值已更新' : ''}
> >
{info.getValue() ?? '—'} {info.getValue() ?? '—'}

View File

@@ -1540,8 +1540,8 @@ input[type="number"] {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
scrollbar-width: none; scrollbar-width: none;
-ms-overflow-style: none; -ms-overflow-style: none;
left: 12px; left: 13px;
right: 12px; right: 13px;
box-sizing: border-box; box-sizing: border-box;
} }
.mobile-fund-table-portal-header::-webkit-scrollbar { .mobile-fund-table-portal-header::-webkit-scrollbar {
@@ -3366,4 +3366,4 @@ input[type="number"] {
body { body {
@apply bg-background text-foreground; @apply bg-background text-foreground;
} }
} }