Skip to content

Commit

Permalink
fix(listview): [Android] Fix drag-to-reorder not applying
Browse files Browse the repository at this point in the history
Fix bug where drag-to-reorder would sometimes not be applied if item was dragged quickly, specifically in the case were the timing of events runs DragOver (pointer moved) -> Drop (pointer up) -> measure+arrange.
  • Loading branch information
davidjohnoliver committed Sep 17, 2021
1 parent 05b68c2 commit 4a49f7d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2127,6 +2127,10 @@ internal void UpdateReorderingItem(Windows.Foundation.Point location, FrameworkE

internal Uno.UI.IndexPath? CompleteReorderingItem(FrameworkElement element, object item)
{
// Ensure that _pendingReorder.index is set. This is necessary in case it was invalidated from UpdateReorderingItem() but the
// list was not yet remeasured, which can happen when dragging rapidly.
GetAndUpdateReorderingIndex();

var updatedIndex = default(Uno.UI.IndexPath?);
if (_pendingReorder?.index is { } index)
{
Expand Down

0 comments on commit 4a49f7d

Please sign in to comment.