From ee06dda98cfe918528a0359895768979919ab7b9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 18 Mar 2025 07:23:40 -0700 Subject: feat: Development commit --- Sora/Views/Post/Grid/PostGridView.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index cc3a3cd..78d90b3 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -16,7 +16,7 @@ struct PostGridView: View { } var body: some View { - ScrollViewReader { _ in + ScrollViewReader { proxy in ScrollView { if filteredPosts.isEmpty { ProgressView() @@ -25,6 +25,7 @@ struct PostGridView: View { WaterfallGrid(filteredPosts, id: \.id) { post in waterfallGridContent(post: post) + .id(post.id) } .gridStyle(columns: settings.thumbnailGridColumns) .padding(8) @@ -89,14 +90,20 @@ struct PostGridView: View { } PlatformSpecificToolbarItem { - Button(action: { manager.goBackInHistory() }) { + Button(action: { + manager.goBackInHistory() + withAnimation { proxy.scrollTo(filteredPosts.first?.id) } + }) { Label("Previous Search", systemImage: "chevron.left") } .disabled(!manager.canGoBackInHistory) } PlatformSpecificToolbarItem { - Button(action: { manager.goForwardInHistory() }) { + Button(action: { + manager.goForwardInHistory() + withAnimation { proxy.scrollTo(filteredPosts.first?.id) } + }) { Label("Next Search", systemImage: "chevron.right") } .disabled(!manager.canGoForwardInHistory) -- cgit v1.2.3