ra1028 / DiffableDataSources

💾 A library for backporting UITableView/UICollectionViewDiffableDataSource.
https://ra1028.github.io/DiffableDataSources
Apache License 2.0
849 stars 68 forks source link

Applying a snapshot near the bottom of a table view jumps its scroll position #42

Open rafaelnobrekz opened 1 year ago

rafaelnobrekz commented 1 year ago

Checklist

Expected Behavior

On tableView didSelect delegate callback, I toggle the snapshot's Item isSelected property and apply a new snapshot with this data changed (otherwise selection would be lost when reusing cells, as the selection is set in my cell provider from the item) When using the native UITableViewDiffableDataSource, the table view remains at the same content offset no matter where I apply the snapshot from.

Current Behavior

When using DiffableDataSource's TableViewDiffableDataSource, and the tableview's bottommost rows are visible, the scrolling position is offset after applying a snapshot

Reproducible Demo Project

https://github.com/rafaelnobrekz/DiffableDataSourceOffsetBug

Environments