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.63k stars 1.62k forks source link

Windows adds a range of items to a CollectionView in reverse #22096

Open KeithBoynton opened 2 weeks ago

KeithBoynton commented 2 weeks ago

Description

When adding a range of items, say a string list

new List<string>() { "One", "Two", "Three", "Four", "Five" }

to a CollectionView via an event on Windows it adds it in reverse whereas on iOS, MacCatalyst and Android it add them in the correct order.

Steps to Reproduce

  1. Clone the attached project
  2. Run the solution on MacCatalyst
  3. Click the Add button and observe the items in the correct order
  4. Run the solution on iOS
  5. Click the Add button and observe the items in the correct order
  6. Run the solution on Android
  7. Click the Add button and observe the items in the correct order
  8. Run the solution on Windows
  9. Click the Add button and observe the items in the incorrect REVERSE order

Link to public reproduction project repository

https://bitbucket.org/KeithBoynton/collection-view-reverse/src/master/

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

Zhanglirong-Winnie commented 2 weeks ago

Verified this issue with Visual Studio 17.10.0 Preview 5(8.0.21&8.0.14&8.0.3). Can repro on windows platforms with sample project. Android: image Windows: image

wyyqyl commented 1 week ago
#if WINDOWS
            changedItems.Reverse();
#endif
KeithBoynton commented 1 week ago
#if WINDOWS
            changedItems.Reverse();
#endif

Lets not do that, it's a bug