diff --git a/src/AvaloniaEdit/CodeCompletion/CompletionList.cs b/src/AvaloniaEdit/CodeCompletion/CompletionList.cs index 96d1b72..3a3a566 100644 --- a/src/AvaloniaEdit/CodeCompletion/CompletionList.cs +++ b/src/AvaloniaEdit/CodeCompletion/CompletionList.cs @@ -27,6 +27,7 @@ using Avalonia.Controls.Primitives; using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.Markup.Xaml.Templates; +using Avalonia.Threading; using AvaloniaEdit.Utils; namespace AvaloniaEdit.CodeCompletion @@ -321,7 +322,7 @@ namespace AvaloniaEdit.CodeCompletion _currentList = listBoxItems; //_listBox.Items = null; Makes no sense? Tooltip disappeared because of this _listBox.ItemsSource = listBoxItems; - SelectIndexCentered(bestIndex); + Dispatcher.UIThread.Post(() => { SelectIndexCentered(bestIndex); }, DispatcherPriority.Loaded); } ///