You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've detected the following bug in the interactive reordering mechanism:
On UICollectionViewLayout+InteractiveReordering, interactive transaction between two single-item sections and destination of the last spot is treated uniquely as follow:
// if we're moving an item to the last spot, our index would exceed the number of sections available// so we have to special case this scenario. iOS doesnt allow an item move to "create" a new section
adapter.isLastInteractiveMoveToLastSectionIndex = YES;
The problem is, that this logic is done in the method updatedTargetForInteractivelyMovingItem:toIndexPath:adapter: which is called repeatedly during the interactive dragging. Therefore, I can start dragging a single section item to the last spot in the collection view, and by that setting (while still dragging) adapter.isLastInteractiveMoveToLastSectionIndex to YES and then drag the item back (without ever lifting up the finger) to a non-last spot while adapter.isLastInteractiveMoveToLastSectionIndex is still YES. If I will end the dragging then, the adapter will update the items as if the item was dragged to the last spot (because adapter.isLastInteractiveMoveToLastSectionIndex is still set to YES).
The text was updated successfully, but these errors were encountered:
…ordering. (Instagram#1289)
Summary:
Issue fixed: Instagram#1288
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Pull Request resolved: Instagram#1289
Reviewed By: timonus
Differential Revision: D13590406
Pulled By: rnystrom
fbshipit-source-id: 0814b0c2383a185da747176bad57dfb15c7e883f
General information
IGListKit
version: master branchHi,
I've detected the following bug in the interactive reordering mechanism:
On
UICollectionViewLayout+InteractiveReordering
, interactive transaction between two single-item sections and destination of the last spot is treated uniquely as follow:The problem is, that this logic is done in the method
updatedTargetForInteractivelyMovingItem:toIndexPath:adapter:
which is called repeatedly during the interactive dragging. Therefore, I can start dragging a single section item to the last spot in the collection view, and by that setting (while still dragging)adapter.isLastInteractiveMoveToLastSectionIndex
toYES
and then drag the item back (without ever lifting up the finger) to a non-last spot whileadapter.isLastInteractiveMoveToLastSectionIndex
is stillYES
. If I will end the dragging then, the adapter will update the items as if the item was dragged to the last spot (becauseadapter.isLastInteractiveMoveToLastSectionIndex
is still set toYES
).The text was updated successfully, but these errors were encountered: