Skip to content

Commit

Permalink
Fix: Fixed selecting wrong items when creating or renaming an item (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hishitetsu authored Feb 10, 2023
1 parent 720edcf commit 890f58a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Files.App/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,16 @@ private void SetCheckboxSelectionState(object item, ListViewItem? lviContainer =
{
var checkbox = container.FindDescendant("SelectionCheckbox") as CheckBox;
if (checkbox is not null)
{
// Temporarily disable events to avoid selecting wrong items
checkbox.Checked -= ItemSelected_Checked;
checkbox.Unchecked -= ItemSelected_Unchecked;

checkbox.IsChecked = FileList.SelectedItems.Contains(item);

checkbox.Checked += ItemSelected_Checked;
checkbox.Unchecked += ItemSelected_Unchecked;
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/Files.App/Views/LayoutModes/GridViewBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,16 @@ private void SetCheckboxSelectionState(object item, GridViewItem? lviContainer =
{
var checkbox = container.FindDescendant("SelectionCheckbox") as CheckBox;
if (checkbox is not null)
{
// Temporarily disable events to avoid selecting wrong items
checkbox.Checked -= ItemSelected_Checked;
checkbox.Unchecked -= ItemSelected_Unchecked;

checkbox.IsChecked = FileList.SelectedItems.Contains(item);

checkbox.Checked += ItemSelected_Checked;
checkbox.Unchecked += ItemSelected_Unchecked;
}
}
}

Expand Down

0 comments on commit 890f58a

Please sign in to comment.