Skip to content

Commit 163ce18

Browse files
committed
ensure selected item is within view
1 parent a2b5bd1 commit 163ce18

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/TableView.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ private void TableView_SelectionChanged(object sender, SelectionChangedEventArgs
7777

7878
SetCurrentCell(null);
7979
OnCellSelectionChanged();
80+
81+
if (SelectedIndex > 0)
82+
{
83+
DispatcherQueue.TryEnqueue(async () => await ScrollRowIntoView(SelectedIndex));
84+
}
8085
}
8186

8287
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
@@ -1333,7 +1338,7 @@ internal void EnsureCells()
13331338
{
13341339
row.EnsureCells();
13351340
}
1336-
}
1341+
}
13371342
#endif
13381343

13391344
#if WINDOWS

0 commit comments

Comments
 (0)