Remove reaction summary view scroll animation, keep the buttons in sync with manual horizontal scrolling

This commit is contained in:
Stefan Ceriu
2023-06-30 13:01:58 +03:00
committed by Stefan Ceriu
parent 61da51808c
commit a180a08d29

View File

@@ -43,9 +43,7 @@ struct ReactionsSummaryView: View {
HStack {
ForEach(reactions, id: \.self) { reaction in
ReactionSummaryButton(reaction: reaction, highlighted: selectedReactionKey == reaction.key) { key in
withAnimation(.easeInOut) {
selectedReactionKey = key
}
selectedReactionKey = key
}
.id(reaction.key)
}
@@ -54,6 +52,9 @@ struct ReactionsSummaryView: View {
.onAppear {
scrollView.scrollTo(selectedReactionKey, anchor: .leading)
}
.onChange(of: selectedReactionKey) { _ in
scrollView.scrollTo(selectedReactionKey)
}
}
}
.padding(.top, 24)