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.24k stars 1.76k forks source link

Picker Selected item gets cleared in BindableLayout (Android, iOS) - Bug introduced in Microsoft.Maui.Controls 8.0.60 #25729

Open mahesh139 opened 1 week ago

mahesh139 commented 1 week ago

Description

Microsoft.Maui.Controls 8.0.60 has introduced some real problems with Bindable Layout. e.g. https://github.com/CommunityToolkit/Maui/issues/2320

Migration of my App from Xamarin forms to MAUI is never ending.....:( Please help.

Steps to Reproduce

https://github.com/user-attachments/assets/5dd0f27f-eee7-4ed6-acab-e8eaaa5b9791

Link to public reproduction project repository

https://github.com/mahesh139/MAUIBugs

Version with bug

8.0.92 SR9.2

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

iOS, Android

Affected platform versions

Android 13,14. iOS 15

Did you find any workaround?

No.

Relevant log output

No response

similar-issues-ai[bot] commented 1 week ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

Ying-6 commented 1 week ago

This issue has been verified using Visual Studio 17.12.0 Preview 5.0(8.0.92 & 8.0.60 & 8.0.40 & 9.0.0-rc.2.24503.2). Can repro this issue on android and iOS platforms. Works fine on 8.0.40.

rmarinho commented 6 days ago

This is fixed by https://github.com/dotnet/maui/pull/23369 and should be working on 8.0.70 or above

mahesh139 commented 6 days ago

@rmarinho Provided repo is developed with latest version 8.0.92 SR9.2 and its not working. please re-open.

LeoJHarris commented 2 days ago

Is this the same as when scrolling through a CollectionView and scrolling back up that any pickers contained in the CollectionView cells get their selected values cleared? My only work around is to use a ListView with RetainElement set to true,

mahesh139 commented 1 day ago

@LeoJHarris Not sure if its related but I also observed behavior you mentioned. when picker is used inside collection view, selected item gets cleared on collection view scroll.

Picker selected value also gets cleared if you switch collection view item source. (same as original issue reported for bindable layout).

I am going to log a separate issue for collection view with a re-production repo.

LeoJHarris commented 1 day ago

@mahesh139 I have just created a ticket from the issue regarding CollectionView and nested Pickers https://github.com/dotnet/maui/issues/25842