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
21.99k stars 1.72k forks source link

CarouselView Renders Duplicate Data Templates Multiple Times #11571

Open JoeMayo opened 1 year ago

JoeMayo commented 1 year ago

Description

When running the Maui Samples, the CarouselView renders Monkey instances multiple times. In MonkeysViewModel.CreateMoneyCollection the code is loading 17 Monkey objects into Monkeys, an ObservableCollection of Monkey. However, the CarouselView is showing many more items than 17, duplicating the original 17 multiple times. Here's the URL to the solution in the maui-samples repository:

https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/CarouselViewDemos

I ran into this problem with my code and verified that it reproduces with the maui-samples solution too.

Steps to Reproduce

  1. Clone maui-samples
  2. Run the carousel demo at https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/CarouselViewDemos
  3. Select Horizontal Data Template
  4. Observe the duplicated templates.

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/6.0/UserInterface/Views/CarouselViewDemos

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

10.0.17763.0

Did you find any workaround?

No response

Relevant log output

No response

bcaceiro commented 1 year ago

I have the same problem.

rachelkang commented 1 year ago

Hi @JoeMayo - Can you try setting Loop="False" and letting us know if that resolves your issue? (Loop="True" by default)

ghost commented 1 year ago

Hi @JoeMayo. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

JoeMayo commented 1 year ago

@rachelkang Sorry, I added the Loop="False" attribute to the CarouselView, but no change for me.

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

jinxinjuan commented 1 year ago

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on Windows and android platform with sample project. CarouselViewDemos

sps014 commented 11 months ago

Still facing this issue in MAUI .NET 8 RC1.

jerry2007 commented 4 months ago

Still facing this issue

jerry2007 commented 4 months ago

It's not just windows platform.... 👎