Skip to content

Commit 899430f

Browse files
Fixed a crash that would occur when renaming items in the tiles layout (#8189)
1 parent 6a5012d commit 899430f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Files/Views/LayoutModes/GridViewBrowser.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@
335335
x:Name="TileViewTextBoxItemName"
336336
Grid.Row="0"
337337
HorizontalAlignment="Left"
338+
TextChanged="GridViewTextBoxItemName_TextChanged"
338339
Text="{x:Bind ItemName, Mode=OneWay}"
339340
Visibility="Collapsed" />
340341
<TextBlock

src/Files/Views/LayoutModes/GridViewBrowser.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,10 @@ private void EndRename(TextBox textBox)
356356
TextBlock textBlock = (popup.Parent as Grid).Children[1] as TextBlock;
357357
popup.IsOpen = false;
358358
}
359-
else
359+
else if (FolderSettings.LayoutMode == FolderLayoutModes.TilesView)
360360
{
361-
StackPanel parentPanel = textBox.Parent as StackPanel;
362-
TextBlock textBlock = parentPanel.Children[0] as TextBlock;
361+
Grid grid = textBox.Parent as Grid;
362+
TextBlock textBlock = grid.Children[0] as TextBlock;
363363
textBox.Visibility = Visibility.Collapsed;
364364
textBlock.Visibility = Visibility.Visible;
365365
}

0 commit comments

Comments
 (0)