Skip to content

Commit 96b5b3e

Browse files
committed
Fixed tab nav
1 parent 4496ac3 commit 96b5b3e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,14 @@ private void AutoSuggestBox_GettingFocus(UIElement sender, GettingFocusEventArgs
2424
_previouslyFocusedElement = new(args.OldFocusedElement as UIElement);
2525
}
2626

27-
private async void AutoSuggestBox_LosingFocus(UIElement sender, LosingFocusEventArgs args)
27+
private void AutoSuggestBox_LosingFocus(UIElement sender, LosingFocusEventArgs args)
2828
{
2929
if (IsModeButtonPressed)
3030
{
3131
IsModeButtonPressed = false;
3232
args.TryCancel();
3333
return;
3434
}
35-
36-
var keyState = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Tab);
37-
if (keyState.HasFlag(CoreVirtualKeyStates.Down))
38-
{
39-
await Task.Delay(15);
40-
CurrentSelectedMode?.ContentOnInactive?.Focus(FocusState.Keyboard);
41-
}
4235
}
4336

4437
private void AutoSuggestBox_GotFocus(object sender, RoutedEventArgs e)
@@ -56,7 +49,7 @@ private void AutoSuggestBox_LostFocus(object sender, RoutedEventArgs e)
5649
IsFocused = false;
5750
}
5851

59-
private void AutoSuggestBox_KeyDown(object sender, KeyRoutedEventArgs e)
52+
private async void AutoSuggestBox_KeyDown(object sender, KeyRoutedEventArgs e)
6053
{
6154
if (e.Key is VirtualKey.Enter)
6255
{
@@ -107,6 +100,13 @@ private void AutoSuggestBox_KeyDown(object sender, KeyRoutedEventArgs e)
107100
previouslyFocusedElement?.Focus(FocusState.Programmatic);
108101
}
109102
}
103+
else if (e.Key == VirtualKey.Tab && !InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down))
104+
{
105+
e.Handled = true;
106+
IsFocused = false;
107+
await Task.Delay(15);
108+
CurrentSelectedMode?.ContentOnInactive?.Focus(FocusState.Keyboard);
109+
}
110110
else
111111
{
112112
_textChangeReason = OmnibarTextChangeReason.UserInput;

0 commit comments

Comments
 (0)