Browse Source

Fix SelectedItems indexer.

The index is an index into `Ranges`, not `Items`.

Fixes #7974.
pull/9699/head
Steven Kirk 3 years ago
parent
commit
467303099c
  1. 4
      src/Avalonia.Controls/Selection/SelectedItems.cs

4
src/Avalonia.Controls/Selection/SelectedItems.cs

@ -35,9 +35,9 @@ namespace Avalonia.Controls.Selection
{
return _owner.SelectedItem;
}
else if (Items is object)
else if (Items is not null && Ranges is not null)
{
return Items[index];
return Items[IndexRange.GetAt(Ranges, index)];
}
else
{

Loading…
Cancel
Save