@@ -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