Skip to content

Commit 534a843

Browse files
Spacebar on the "Files" node should toggle state
If the "Files" node is partially checked, the user using spacebar will find nothing happens on spacebar because packageItem.IsChecked is null, so !packageItem.IsChecked is also null. Adjust spacebar behavior to match mouseclick behavior
1 parent 7a2d2c0 commit 534a843

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/LibraryManager.Vsix/UI/Controls/PackageContentsTreeView.xaml.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ private void OnPreviewKeyUp(object sender, KeyEventArgs e)
3131

3232
if (packageItem != null)
3333
{
34-
packageItem.IsChecked = !packageItem.IsChecked;
34+
if (packageItem.IsChecked.HasValue)
35+
{
36+
packageItem.IsChecked = !packageItem.IsChecked;
37+
}
38+
else
39+
{
40+
// if it is partially checked, clear all selections, just like clicking with the mouse
41+
packageItem.IsChecked = false;
42+
}
3543
e.Handled = true;
3644
}
3745
}

0 commit comments

Comments
 (0)