Fix for CollectionView Drag and Drop Reordering Can't Drop in Empty Group #31867
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Description:
Dragging and dropping an item into an empty group in the CollectionView was failing. The item could not be dropped because the drag-and-drop logic was not handling empty groups correctly.
RootCause:
The OnMove method controls drag-and-drop behaviour in CollectionView. When dropping into an empty group, the only element present is the group header, which has a different ItemViewType than normal items. Because of this mismatch, the check inside OnMove prevented the drop operation from completing.
Description of Change
Updated the condition in OnMove to validate that the dragged item is a record, allowing drops into empty groups.
Improved comments for the iOS platform implementation to clarify behaviour.
Issues Fixed
Fixes #12008
Tested the behaviour in the following platforms
Output Screenshot
12008before.mov
12008Final.mov