Skip to content
Browse files

fix focusing bug in SharpTreeView

  • Loading branch information...
1 parent 0dc7537 commit 7edf1c4f19153facc7e8c17f81515af1a46b5d64 @siegfriedpammer siegfriedpammer committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Libraries/SharpTreeView/ICSharpCode.TreeView/SharpTreeView.cs
View
2 src/Libraries/SharpTreeView/ICSharpCode.TreeView/SharpTreeView.cs
@@ -151,7 +151,7 @@ void flattener_CollectionChanged(object sender, NotifyCollectionChangedEventArgs
if (selectedOldItems != null) {
var list = SelectedItems.Cast<SharpTreeNode>().Except(selectedOldItems).ToList();
SetSelectedItems(list);
- if (SelectedItem == null) {
+ if (SelectedItem == null && this.IsKeyboardFocusWithin) {
// if we removed all selected nodes, then move the focus to the node
// preceding the first of the old selected nodes
SelectedIndex = Math.Max(0, e.OldStartingIndex - 1);

0 comments on commit 7edf1c4

Please sign in to comment.
Something went wrong with that request. Please try again.