mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fixes #2805 - Fixes animation artifacts when focusing on in-reply-to messages
This commit is contained in:
committed by
Stefan Ceriu
parent
136ecb125c
commit
d8845303fd
@@ -340,10 +340,13 @@ class TimelineTableViewController: UIViewController {
|
||||
|
||||
/// Scrolls to the item with the corresponding event ID if loaded in the timeline.
|
||||
private func scrollToItem(eventID: String, animated: Bool) {
|
||||
if let kvPair = timelineItemsDictionary.first(where: { $0.value.identifier.eventID == eventID }),
|
||||
let indexPath = dataSource?.indexPath(for: kvPair.key) {
|
||||
tableView.scrollToRow(at: indexPath, at: .middle, animated: animated)
|
||||
coordinator.send(viewAction: .scrolledToFocussedItem)
|
||||
DispatchQueue.main.async { [weak self] in // Fixes #2805
|
||||
guard let self else { return }
|
||||
if let kvPair = timelineItemsDictionary.first(where: { $0.value.identifier.eventID == eventID }),
|
||||
let indexPath = dataSource?.indexPath(for: kvPair.key) {
|
||||
tableView.scrollToRow(at: indexPath, at: .middle, animated: animated)
|
||||
coordinator.send(viewAction: .scrolledToFocussedItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user