From 43ae1380805f933ac0d9ffe32e6470e3ae9430cd Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Wed, 30 Aug 2023 01:36:13 +0900 Subject: [PATCH] Update DetailsLayoutBrowser.xaml.cs --- .../Views/LayoutModes/DetailsLayoutBrowser.xaml.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs index b4195d04a320..72d17b5826a2 100644 --- a/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs +++ b/src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs @@ -426,9 +426,20 @@ private async void FileList_ItemTapped(object sender, TappedRoutedEventArgs e) var clickedItem = e.OriginalSource as FrameworkElement; var ctrlPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down); var shiftPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down); - var item = (e.OriginalSource as FrameworkElement)?.DataContext as ListedItem; + var item = clickedItem?.DataContext as ListedItem; if (item is null) + { + if (IsRenamingItem) + { + ListViewItem listViewItem = FileList.ContainerFromItem(RenamingItem) as ListViewItem; + if (listViewItem is not null) + { + var textBox = listViewItem.FindDescendant("ItemNameTextBox") as TextBox; + await CommitRename(textBox); + } + } return; + } // Skip code if the control or shift key is pressed or if the user is using multiselect if