Skip to content

Commit c6ced9d

Browse files
committed
Auto select text when entering edit mode
1 parent 42624e4 commit c6ced9d

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ private void Omnibar_SizeChanged(object sender, SizeChangedEventArgs e)
1717
private void AutoSuggestBox_GotFocus(object sender, RoutedEventArgs e)
1818
{
1919
IsFocused = true;
20+
_textBox.SelectAll();
2021
}
2122

2223
private void AutoSuggestBox_LostFocus(object sender, RoutedEventArgs e)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ protected void ChangeMode(OmnibarMode? oldMode, OmnibarMode newMode)
144144
_textChangeReason = OmnibarTextChangeReason.ProgrammaticChange;
145145
ChangeTextBoxText(newMode.Text ?? string.Empty);
146146

147-
// Move cursor of the TextBox to the tail
148-
_textBox.Select(_textBox.Text.Length, 0);
149-
150147
VisualStateManager.GoToState(newMode, "Focused", true);
151148
newMode.OnChangingCurrentMode(true);
152149

0 commit comments

Comments
 (0)