Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker regression in 8.0.60 #23367

Closed
BurningLights opened this issue Jul 1, 2024 · 1 comment · Fixed by #23369
Closed

Picker regression in 8.0.60 #23367

BurningLights opened this issue Jul 1, 2024 · 1 comment · Fixed by #23369
Labels
p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working
Milestone

Comments

@BurningLights
Copy link
Contributor

Description

There is a regression in the behavior of Picker when, upon selection of an item, a new item is inserted into an ObservableCollection that serves as the ItemsSource before the currently selected item, and the SelectedIndex is incremented to keep the same item selected. This worked in 8.0.40 and before, and now in 8.0.60 and 8.0.61 results in an infinite loop that locks up the application.

Steps to Reproduce

  1. Create a new MAUI Project
  2. In the MainPage, create an ObservableCollection property to serve as the ItemsSource and an int property to serve as the SelectedIndex
  3. In the setter for the SelectedIndex property, if the new value is equal to 0, insert a new item at the beginning of the ObservableCollection and then increment the SelectedIndex property.
  4. Ensure that the ObservableCollection is populated with a couple options and the SelectedIndex is set to the second item in the list.
  5. Set the MainPage's BindingContext to itself.
  6. Add a Picker to the XAML and bind the ObservableCollection property to ItemsSource and the integer property to SelectedIndex.
  7. Run the application
  8. Select the first option from the picker.
  9. The application will lock up on version 8.0.60 or later. It should insert a new item at the beginning and keep the current selection.

Link to public reproduction project repository

https://github.com/BurningLights/MauiPickerIssue

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.40 SR5

Affected platforms

Android, Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@BurningLights BurningLights added the t/bug Something isn't working label Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@samhouts samhouts added platform/windows 🪟 platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending labels Jul 1, 2024
@PureWeen PureWeen added this to the .NET 8 SR7 milestone Jul 1, 2024
@PureWeen PureWeen added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants