Pārlūkot izejas kodu

Fix selection after initialization.

Fixes first item in menus being selected when menu is shown.
Steven Kirk 6 gadi atpakaļ
vecāks
revīzija
60e3c3c977

+ 3 - 1
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

@@ -1088,7 +1088,9 @@ namespace Avalonia.Controls.Primitives
                 }
                 else
                 {
-                    SelectedIndex = _updateSelectedIndex != int.MinValue ? _updateSelectedIndex : 0;
+                    SelectedIndex = _updateSelectedIndex != int.MinValue ? 
+                        _updateSelectedIndex : 
+                        AlwaysSelected ? 0 : -1;
                 }
             }
         }