Skip to content

Alignment bug on simultaneous insertion and refresh  #71

Open
@ekazaev

Description

@ekazaev

Describe the bug
An attempt to make two simultaneous changes in collection view causes UI glitches

To Reproduce
Add the next piece of code to the performBatchUpdates

          let itemInfo1 = ItemInfo(
              sizeMode: state.sizeMode,
              text: "Test test test test test test",
              color: state.color)
          self?.dataSource.removeItem(atItemIndex: 3, inSectionAtIndex: 0)
          self?.dataSource.insert(itemInfo1, atItemIndex: 3, inSectionAtIndex: 0)
          self?.collectionView.reloadItems(at: [IndexPath(item: 3, section: 0)])

Run the project and insert an item
You will see the effect that is described in the video. Cells will start animation from the wrong position and finish it in the wrong place

Expected behavior
All the items will reorder and update according to their positions

Screenshots
https://www.dropbox.com/s/rzfa5g8qbiamlcm/Missalignmets.mov?dl=0
Screenshot 2020-03-27 at 00 58 11
Smartphone (please complete the following information):

  • Device/Simulator: iPhone 11/XR (Simulator)
  • OS: iOS12/13

Additional context
You did a fantastic job.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions