Skip to content

Commit 4724735

Browse files
committed
Fix 'When using Edit path mode, switching tabs and then switching back reopens the Omnibar flyout'
1 parent ae591bc commit 4724735

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

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

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

27-
private void AutoSuggestBox_LosingFocus(UIElement sender, LosingFocusEventArgs args)
28-
{
29-
if (IsModeButtonPressed)
30-
{
31-
IsModeButtonPressed = false;
32-
args.TryCancel();
33-
return;
34-
}
35-
}
36-
3727
private void AutoSuggestBox_GotFocus(object sender, RoutedEventArgs e)
3828
{
3929
GlobalHelper.WriteDebugStringForOmnibar("The TextBox got the focus.");

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public partial class Omnibar : Control
3333

3434
private WeakReference<UIElement?> _previouslyFocusedElement = new(null);
3535

36-
// NOTE: This is a workaround to keep Omnibar's focus on a mode button being clicked
37-
internal bool IsModeButtonPressed { get; set; }
38-
3936
// Events
4037

4138
public event TypedEventHandler<Omnibar, OmnibarQuerySubmittedEventArgs>? QuerySubmitted;
@@ -77,7 +74,6 @@ protected override void OnApplyTemplate()
7774
SizeChanged += Omnibar_SizeChanged;
7875
_textBox.GettingFocus += AutoSuggestBox_GettingFocus;
7976
_textBox.GotFocus += AutoSuggestBox_GotFocus;
80-
_textBox.LosingFocus += AutoSuggestBox_LosingFocus;
8177
_textBox.LostFocus += AutoSuggestBox_LostFocus;
8278
_textBox.KeyDown += AutoSuggestBox_KeyDown;
8379
_textBox.TextChanged += AutoSuggestBox_TextChanged;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ private void ModeButton_Click(object sender, RoutedEventArgs e)
4949
if (_ownerRef is null || _ownerRef.TryGetTarget(out var owner) is false || owner.CurrentSelectedMode == this)
5050
return;
5151

52-
owner.IsModeButtonPressed = true;
5352
owner.CurrentSelectedMode = this;
5453
}
5554
}

0 commit comments

Comments
 (0)