diff --git a/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs b/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs index 2e9844d23b..3a7fd1664a 100644 --- a/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs +++ b/ILSpy/AssemblyTree/AssemblyListPane.xaml.cs @@ -71,7 +71,10 @@ protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) if (SelectedItem is SharpTreeNode selectedItem) { // defer focusing, so it does not interfere with selection via mouse click - this.BeginInvoke(() => FocusNode(selectedItem)); + this.BeginInvoke(() => { + if (this.SelectedItem == selectedItem) + FocusNode(selectedItem); + }); } else {