Fix Android CarouselView so you don't need to add a delay after switching ItemSources to Set Position
Description
The following PR made the situation better, but I don't think it's still quite perfect. We merged it for now because it at least fixes the issue where setting the position completely didn't work.
https://github.com/dotnet/maui/pull/24431
Ideally this code should still work without the delay here
https://github.com/Tamilarasan-Paranthaman/maui/blob/8a1cbc3806a82ac1676da013761b397827fd66cd/src/Controls/tests/TestCases.HostApp/Issues/Issue17283.xaml.cs#L52-L57
I'm wondering if we should just skip the ScrollHelper code here if the _oldPosition is zero?
If the CurrentItem is null and the Position is zero it doesn't seem like the scroll code should run at all should it?
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:
- [iOS] CarouselView doesn't scroll to the right Position after changing the ItemSource with Loop enabled (#24105), similarity score: 0.71
- Carousel view not updating it's position on initial interaction (#11559), similarity score: 0.71
- [Android] CarouselView doesn't scroll to the right Position after changing the ItemSource with Loop enabled (#17283), similarity score: 0.70
Closed similar issues:
- CarouselView doesn't scroll to the CurrentItem when set (#7575), similarity score: 0.73
- CarouselView Position property not updating after changing ItemsSource (#6328), similarity score: 0.70
Note: You can give me feedback by thumbs upping or thumbs downing this comment.