Open optsing opened 5 months ago
When mounted, TabStrip changes SelectedItem to the first one and then reverts it back.
Add TabStrip to View, add TabItems and CurrentItem to ViewModel, watch CurrentItem changes.
public partial class MainViewModel : ViewModelBase { public List<string> TabItems { get; } = ["Tab1", "Tab2", "Tab3"]; [ObservableProperty] public string currentItem = "Tab2"; partial void OnCurrentItemChanged(string value) { Debug.WriteLine(value); } }
Just run the application and look at the logs:
Tab1 Tab2
TabStrip should not change SelectedItem when mounted, like ListBox does not change it.
11.0.10
Windows
No response
Apparently, the problem is with AlwaysSelected in SelectingItemsControl.cs and is relevant for 11.1.0-rc1
Describe the bug
When mounted, TabStrip changes SelectedItem to the first one and then reverts it back.
To Reproduce
Add TabStrip to View, add TabItems and CurrentItem to ViewModel, watch CurrentItem changes.
Just run the application and look at the logs:
Expected behavior
TabStrip should not change SelectedItem when mounted, like ListBox does not change it.
Avalonia version
11.0.10
OS
Windows
Additional context
No response