Skip to content

[Android] Fix VerifyFlowDirectionRTLCanReorderItemsTrueWithCanMixGroups test failure regression#35000

Merged
kubaflo merged 1 commit intodotnet:inflight/candidatefrom
SuthiYuvaraj:Fix-FailureGroup
Apr 17, 2026
Merged

[Android] Fix VerifyFlowDirectionRTLCanReorderItemsTrueWithCanMixGroups test failure regression#35000
kubaflo merged 1 commit intodotnet:inflight/candidatefrom
SuthiYuvaraj:Fix-FailureGroup

Conversation

@SuthiYuvaraj
Copy link
Copy Markdown
Contributor

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

Fixes a regression introduced by PR #31867, where all grouped CollectionView drag-and-drop reorder tests fail on Android — most visibly VerifyFlowDirectionRTLCanReorderItemsTrueWithCanMixGroups.

Root cause

PR #31867 changed SimpleItemTouchHelperCallback.OnMove from checking the target view type to checking the source view type, so that items can be dropped onto empty group headers. The side effect: OnItemMove can now be called with a non-empty group's GroupHeader as toPosition.

When dragging an item forward past the next group's header (e.g., "Banana" toward "Potato"), OnItemMove fires with the GroupHeader as target and prematurely inserts the item mid-gesture, before the drop is intentional.

LTR tests pass accidentally — the premature insertion moves the item downward, so the newY > initialY assertion coincidentally passes.
RTL test fails — the mid-gesture NotifyItemMoved causes a layout pass that makes ItemTouchHelper's internal gesture offset stale in RTL coordinate space, aborting the drag and leaving newY == initialY.

Description of Change

Added a guard in ReorderableItemsViewAdapter.OnItemMove: when the drag targets a non-empty group's header (toIndex == 0, HasHeader == true, Count > 0), return false immediately — no data mutation, drag continues cleanly. Empty group headers are still allowed as drop targets, preserving the original PR #31867 intent.

Issues Fixed

Output

Before After

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Apr 16, 2026
@SuthiYuvaraj SuthiYuvaraj changed the title Update ReorderableItemsViewAdapter.cs [Android] Fix VerifyFlowDirectionRTLCanReorderItemsTrueWithCanMixGroups test failure regression Apr 16, 2026
@sheiksyedm
Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@kubaflo kubaflo merged commit ccee182 into dotnet:inflight/candidate Apr 17, 2026
62 of 88 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR6 milestone Apr 17, 2026
Ahamed-Ali pushed a commit that referenced this pull request Apr 22, 2026
…ps test failure regression (#35000)

<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Description

Fixes a regression introduced by PR #31867, where all grouped
CollectionView drag-and-drop reorder tests fail on Android — most
visibly `VerifyFlowDirectionRTLCanReorderItemsTrueWithCanMixGroups`.

### Root cause

PR #31867 changed SimpleItemTouchHelperCallback.OnMove from checking the
target view type to checking the source view type, so that items can be
dropped onto empty group headers. The side effect: OnItemMove can now be
called with a non-empty group's GroupHeader as toPosition.

When dragging an item forward past the next group's header (e.g.,
"Banana" toward "Potato"), OnItemMove fires with the GroupHeader as
target and prematurely inserts the item mid-gesture, before the drop is
intentional.

LTR tests pass accidentally — the premature insertion moves the item
downward, so the newY > initialY assertion coincidentally passes.
RTL test fails — the mid-gesture NotifyItemMoved causes a layout pass
that makes ItemTouchHelper's internal gesture offset stale in RTL
coordinate space, aborting the drag and leaving newY == initialY.


### Description of Change
Added a guard in `ReorderableItemsViewAdapter.OnItemMove:` when the drag
targets a non-empty group's header (toIndex == 0, HasHeader == true,
Count > 0), return false immediately — no data mutation, drag continues
cleanly. Empty group headers are still allowed as drop targets,
preserving the original PR #31867 intent.


### Issues Fixed

- Regression introduced by PR #31867
- **Resolved test case:**
VerifyFlowDirectionRTLCanReorderItemsTrueWithCanMixGroups

### Output
| Before | After |
|----------|----------|
| <img
src="https://github.com/user-attachments/assets/e61cb83d-d631-4a75-9715-85366cad9593">
| <img
src="https://github.com/user-attachments/assets/9f10fd8b-f173-426d-ae54-79daa82beb56">|
@PureWeen PureWeen modified the milestones: .NET 10 SR6, .NET 10 SR7 Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android regressed-in-inflight/candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants