Skip to content

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

Description

@rafaelnobrekz

Checklist

  • This is not a Apple's bug.
  • Reviewed the README and documents.
  • Searched existing issues for ensure not duplicated.

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

  • version: 0.5

  • Swift version: 5.5

  • iOS version: 11-16

  • Xcode version: 14.2

  • Devices/Simulators:

  • CocoaPods/Carthage version:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions