Describe the bug
#20798 introduces a change in behaviour which breaks our application. We want the default selected item of a SelectingItemsControl to be a hidden item at index 0, but now the first visible and enabled index is forcibly selected during startup.
It's legal to have a hidden item selected: we can still programatically select the hidden item at index 0. But now, Avalonia picks a fight with us about this when the control is first created.
The new behaviour occurs even if SelectedIndex="0" has been specified.
To Reproduce
<TabStrip SelectedIndex="0">
<TabStripItem IsVisible="False" Content="HELLO"/>
<TabStripItem Content="WORLD"/>
</TabStrip>
The selected item will be "WORLD", even though I specified that it should be "HELLO".
You can re-select index 0 after the TapStrip has fully initialised, but at this point the side-effects of selecting index 1 have already occurred.
Expected behavior
The first item of a SelectingItemsControl is selected by default even if that item is hidden or disabled. Don't try to behave as if the user interacted with the control, they didn't!
If this new behaviour really is the intent, than at the very least the value of SelectedIndex should be respected so that the initial auto-selection of a visible+enabled item can be avoided.
Avalonia version
12.1.1
OS
No response
Additional context
No response
Describe the bug
#20798 introduces a change in behaviour which breaks our application. We want the default selected item of a
SelectingItemsControlto be a hidden item at index 0, but now the first visible and enabled index is forcibly selected during startup.It's legal to have a hidden item selected: we can still programatically select the hidden item at index 0. But now, Avalonia picks a fight with us about this when the control is first created.
The new behaviour occurs even if
SelectedIndex="0"has been specified.To Reproduce
The selected item will be "WORLD", even though I specified that it should be "HELLO".
You can re-select index 0 after the
TapStriphas fully initialised, but at this point the side-effects of selecting index 1 have already occurred.Expected behavior
The first item of a
SelectingItemsControlis selected by default even if that item is hidden or disabled. Don't try to behave as if the user interacted with the control, they didn't!If this new behaviour really is the intent, than at the very least the value of
SelectedIndexshould be respected so that the initial auto-selection of a visible+enabled item can be avoided.Avalonia version
12.1.1
OS
No response
Additional context
No response