Fix jump to present not scrolling all the way to the top
This commit is contained in:
parent
9f7d16a70e
commit
40800f964d
|
@ -348,9 +348,13 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
|
||||||
config.action = { [unowned self] toast in
|
config.action = { [unowned self] toast in
|
||||||
toast.dismissToast(animated: true)
|
toast.dismissToast(animated: true)
|
||||||
|
|
||||||
self.dataSource.apply(snapshot, animatingDifferences: false)
|
self.dataSource.apply(snapshot, animatingDifferences: true) {
|
||||||
|
// TODO: we can't set prevScrollOffsetBeforeScrollToTop here to allow undoing the scroll-to-top
|
||||||
self.collectionView.scrollToTop()
|
// because that would involve scrolling through unmeasured-cell which fucks up the content offset values.
|
||||||
|
// we probably need a data-source aware implementation of scrollToTop which uses item & offset w/in item
|
||||||
|
// to track the restore position
|
||||||
|
self.collectionView.scrollToItem(at: IndexPath(row: 0, section: 0), at: .top, animated: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.showToast(configuration: config, animated: true)
|
self.showToast(configuration: config, animated: true)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue