Browse Source

Don't coerce when deselecting a range.

If the deselection happens because of a `Clear` during a source collection changed event handler, then the selected indexes may not be in the valid range of the post-change items. In this case, we still want the items to be cleared, and not coercing the range has no downside.
pull/4688/head
Steven Kirk 6 years ago
parent
commit
b5f81e5290
  1. 7
      src/Avalonia.Controls/Selection/SelectionModel.cs

7
src/Avalonia.Controls/Selection/SelectionModel.cs

@ -242,12 +242,7 @@ namespace Avalonia.Controls.Selection
{
using var update = BatchUpdate();
var o = update.Operation;
var range = CoerceRange(start, end);
if (range.Begin == -1)
{
return;
}
var range = new IndexRange(start, end);
if (RangesEnabled)
{

Loading…
Cancel
Save