Remove reaction summary view scroll animation, keep the buttons in sync with manual horizontal scrolling
This commit is contained in:
committed by
Stefan Ceriu
parent
61da51808c
commit
a180a08d29
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user