From a180a08d2998fb3245280491c8bc547ce5ca5830 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 30 Jun 2023 13:01:58 +0300 Subject: [PATCH] Remove reaction summary view scroll animation, keep the buttons in sync with manual horizontal scrolling --- .../View/Supplementary/ReactionsSummaryView.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift b/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift index ee3dec660..8192ee68d 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift @@ -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)