Skip to content

Commit ba9419d

Browse files
committed
Scroll to top of list
1 parent 373c353 commit ba9419d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Files.App.Controls/Omnibar/Omnibar.Events.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ private void AutoSuggestBoxSuggestionsPopup_GettingFocus(UIElement sender, Getti
129129
args.TryCancel();
130130
}
131131

132+
private void AutoSuggestBoxSuggestionsPopup_Opened(object? sender, object e)
133+
{
134+
if (_textBoxSuggestionsListView.Items.Count >= 0)
135+
_textBoxSuggestionsListView.ScrollIntoView(_textBoxSuggestionsListView.Items[0]);
136+
}
137+
132138
private void AutoSuggestBoxSuggestionsListView_ItemClick(object sender, ItemClickEventArgs e)
133139
{
134140
if (CurrentSelectedMode is null)

src/Files.App.Controls/Omnibar/Omnibar.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ protected override void OnApplyTemplate()
7979
_textBox.KeyDown += AutoSuggestBox_KeyDown;
8080
_textBox.TextChanged += AutoSuggestBox_TextChanged;
8181
_textBoxSuggestionsPopup.GettingFocus += AutoSuggestBoxSuggestionsPopup_GettingFocus;
82+
_textBoxSuggestionsPopup.Opened += AutoSuggestBoxSuggestionsPopup_Opened;
8283
_textBoxSuggestionsListView.ItemClick += AutoSuggestBoxSuggestionsListView_ItemClick;
8384
_textBoxSuggestionsListView.SelectionChanged += AutoSuggestBoxSuggestionsListView_SelectionChanged;
8485

0 commit comments

Comments
 (0)