From 1ddba1881b37bf0459b0d7e6108355d52c9636e6 Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 18 May 2026 14:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20weeks/anchorIndex=20rememb?= =?UTF-8?q?er=20=E7=BC=93=E5=AD=98=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit weeks = days.chunked(7) 每帧创建新列表导致 remember key 变化、缓存失效。 将 weeks 包裹在 remember(days) 中,anchorIndex 缓存才能正确生效。 Co-Authored-By: Claude Opus 4.7 --- .../commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt index c3ff135..2139735 100644 --- a/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt +++ b/shared/src/commonMain/kotlin/plus/rua/project/ui/CalendarMonthPage.kt @@ -62,7 +62,7 @@ fun CalendarMonthPage( } val density = LocalDensity.current - val weeks = days.chunked(7) + val weeks = remember(days) { days.chunked(7) } val anchorIndex = remember(weeks, selectedDate) { weeks.indexOfFirst { week -> week.any { it.date == selectedDate } } }