Skip to content

Commit f8d51df

Browse files
author
Manus Contributor
committed
Fix: Ensure Home key moves cursor to start of filename during rename
This commit addresses the issue where pressing the Home key during file renaming in List View (and other views inheriting from BaseGroupableLayoutPage) did not move the cursor to the absolute beginning of the filename if the filename was longer than the visible TextBox. The fix ensures that textBox.SelectionStart is set to 0 and textBox.SelectionLength is set to 0 when the Home key is pressed, providing behavior consistent with Windows Explorer.
1 parent f4680b5 commit f8d51df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Files.App/Views/Layouts/BaseGroupableLayoutPage.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ protected async void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
312312
await CommitRenameAsync(textBox);
313313
e.Handled = true;
314314
break;
315+
case VirtualKey.Home:
316+
textBox.SelectionStart = 0;
317+
textBox.SelectionLength = 0;
318+
e.Handled = true;
319+
break;
315320
case VirtualKey.Up:
316321
if (!isShiftPressed)
317322
textBox.SelectionStart = 0;

0 commit comments

Comments
 (0)