dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

Picker ItemsSource changed case exception: Value does not fall within the expected range #25792

Open xyeie opened 1 week ago

xyeie commented 1 week ago

Description

When the initial bound source elements of the picker are 4, and an item with an index of 3 is selected, changing the source elements of the picker to 2 will immediately result in an exception, indicating that "Value does not fall within the expected range."

Ideally, after switching the data source, the selectedIndex should revert to the default value of -1.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

no

Relevant log output