From cf20b6cb46b10c2adf0a967235f7d23efb73761c Mon Sep 17 00:00:00 2001 From: Ambroise Decouttere Date: Wed, 25 Jan 2023 10:48:15 +0100 Subject: [PATCH] fix: Feedback remove scrollTo --- Mail/Views/Thread/ThreadView.swift | 34 ++++++++++++------------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/Mail/Views/Thread/ThreadView.swift b/Mail/Views/Thread/ThreadView.swift index 6fa41bb48..af24a3dbf 100644 --- a/Mail/Views/Thread/ThreadView.swift +++ b/Mail/Views/Thread/ThreadView.swift @@ -74,29 +74,21 @@ struct ThreadView: View { value: geometry.frame(in: .named("scrollView")).origin ) } - .frame(width: 0, height: 0) + .frame(width: 0, height: 0) - Text(thread.formattedSubject) - .textStyle(.header2) - .frame(maxWidth: .infinity, alignment: .leading) - .multilineTextAlignment(.leading) - .lineSpacing(8) - .padding(.top, 8) - .padding(.bottom, 16) - .padding(.horizontal, 16) - .background(MailResourcesAsset.backgroundColor.swiftUiColor) + Text(thread.formattedSubject) + .textStyle(.header2) + .frame(maxWidth: .infinity, alignment: .leading) + .multilineTextAlignment(.leading) + .lineSpacing(8) + .padding(.top, 8) + .padding(.bottom, 16) + .padding(.horizontal, 16) + .background(MailResourcesAsset.backgroundColor.swiftUiColor) - MessageListView(messages: messages) - .padding(.top, 8) - .background(threadBackground) - .onAppear { - DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { - withAnimation { - proxy.scrollTo(messages.last?.uid, anchor: .top) - } - } - } - } + MessageListView(messages: messages) + .padding(.top, 8) + .background(threadBackground) } } .coordinateSpace(name: "scrollView")