From f0dfddb910c0606b0fbbb02c0e0e26f22e3b9f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Mon, 5 Oct 2026 11:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D(=E5=85=85=E5=80=BC=E5=BC=B9?= =?UTF-8?q?=E5=B1=82):=20=E6=9C=AA=E9=80=89=E4=B8=AD=E6=97=B6=E5=B7=A6?= =?UTF-8?q?=E6=96=B9=E5=90=91=E9=94=AE=E5=9B=9E=E5=8D=B7=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - resolveRovingIndex 的 currentIndex 允许为 -1,ArrowLeft 特判为 length-1,避免落到倒数第二项 --- .../src/components/PlatformProfileRechargeModal/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx index 619bfae2e..04ed1522c 100644 --- a/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx +++ b/packages/shared/src/components/PlatformProfileRechargeModal/index.tsx @@ -54,7 +54,10 @@ function resolveRovingIndex( case 'End': return length - 1; case 'ArrowLeft': - return (currentIndex - 1 + length) % length; + // 未选中(-1)时应回卷到最后一项,而不是 (length - 2) % length。 + return currentIndex < 0 + ? length - 1 + : (currentIndex - 1 + length) % length; case 'ArrowRight': return (currentIndex + 1) % length; default: