Skip to content

Commit

Permalink
Fix: Fixed issue where middle clicking selected folders would cause c…
Browse files Browse the repository at this point in the history
…rash (#12683)
  • Loading branch information
yaira2 authored Jun 22, 2023
1 parent 0e5691a commit 716eec0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ override public void StartRenameItem()
return;

var textBox = listViewItem.FindDescendant("ItemNameTextBox") as TextBox;
if (textBox is null)
if (textBox is null || textBox.FindParent<Grid>() is null)
return;

Grid.SetColumnSpan(textBox.FindParent<Grid>(), 8);
Expand Down
8 changes: 8 additions & 0 deletions src/Files.App/Views/LayoutModes/StandardLayoutMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ protected virtual void StartRenameItem(string itemNameTextBox)
OldItemName = textBlock.Text;
textBlock.Visibility = Visibility.Collapsed;
textBox.Visibility = Visibility.Visible;

if (textBox.FindParent<Grid>() is null)
{
textBlock.Visibility = Visibility.Visible;
textBox.Visibility = Visibility.Collapsed;
return;
}

Grid.SetColumnSpan(textBox.FindParent<Grid>(), 8);

textBox.Focus(FocusState.Pointer);
Expand Down

0 comments on commit 716eec0

Please sign in to comment.