Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CollectionView initial selection is broken #13592

Closed
Tommigun1980 opened this issue Jan 30, 2021 · 7 comments · Fixed by #14621
Closed

[Bug] CollectionView initial selection is broken #13592

Tommigun1980 opened this issue Jan 30, 2021 · 7 comments · Fixed by #14621

Comments

@Tommigun1980
Copy link

Tommigun1980 commented Jan 30, 2021

Description

When using SelectionMode="Multiple" in a CollectionView, the initial SelectedItems are not processed properly.

Screenshot 2021-01-30 at 4 25 59

(SelectionMode="Single" + SelectedItem also seem to be broken in a very similar way, but this report focuses on SelectionMode="Multiple". Any fix should preferably fix both selection modes.)


Please see the following video:
https://user-images.githubusercontent.com/60286968/106343894-5aad3900-62b0-11eb-9fd0-dd545dcb4c05.mov

To summarise the bugs with initial selection:

  1. The initial selection is not visualised by the CollectionView as selected.
  2. Clicking a few times on an item that exists in the initial selection makes the CollectionView treat that element properly.

Walkthrough of video:

  1. Focus on the left-most CollectionView, and on the Log at the bottom.
  2. The CollectionView is loaded with 20 strings ("0" to "19"), and the first three items are selected ("0", "1", "2").
  3. The log says the selection is {0, 1, 2}, however, the CollectionView does not visualise said items as selected.
  4. I click on 3, it is added to the selection (see the log), its selection is visualised properly (as it's not part of the initial selection).
  5. I click on 2 (part of initial selection), the selection is now {0, 1, 2, 3, 2} (notice the duplicate 2), and that element's selection now visualizes properly.
  6. I click on 2 again, the selection is now {0, 1, 3, 2}, the selection highlight didn't go away, and at this point element 2 starts to work properly. (Please note that the CollectionView removed the initial selection item 2 from the list with this click.)

A plea:
This is really breaking my app, so is there any chance this could get fixed soon? Even though not directly related, #8323 touches upon the internals for CollectionView selections, so is there a chance that would fix this issue as well?
Working selection support is an important feature so I am hoping for a prompt fix, if at all possible.


Bonus issue very closely related follows:

Please see the following video:
https://user-images.githubusercontent.com/60286968/106344051-43bb1680-62b1-11eb-802d-9eae280a4824.mov

So for primitive data types the issues are as follows:

  1. Clicking on items to select them briefly makes them get drawn as selected, but the CollectionView instantly removes the selection highlight (the items do get appended to the selection list though).
  2. Clicking on any item that is already selected (albeit not visualized as selected due to the above bug), appends it to the selection list again (so you can have tons of duplicates in the selection list).

Walkthrough of video:

  1. Focus on the right-most CollectionView, and on the Log at the bottom.
  2. The CollectionView is loaded with 20 integers (0 to 19), and the first three items are selected (0, 1, 2).
  3. The log says the selection is {0, 1, 2}, however, the CollectionView does not visualise said items as selected.
  4. I click on 4 (not part of initial selection), it is added to the selection (see the log), but the selection highlight just briefly flashes on and off.
  5. Same for element 7 (not part of initial selection).
  6. I click on 2 (already in the selection list), the selection is now {0, 1, 2, 4, 7, 2} (notice the duplicate 2), and the highlight doesn't work for that either.

This is on iOS, I didn't test it on Android.

Steps to Reproduce

Run the attached repro project.

For the 'initial selection doesn't work for reference types' bug, click on the list on the left side.
For the 'selection doesn't work at all for value types' bug, click on the list on the right side.
Restart the app when toggling between bugs to clear the log.

Expected Behavior

  • Initial selection should work for reference types.
  • Selection should work for value types.

Actual Behavior

  • Initial selection does not work for reference types.
  • Selection does not work at all for value types.

Basic Information

  • Version with issue: XF 5.0.0.1931
  • Last known good version: None
  • Platform Target Frameworks:
    • iOS: 14.2

Environment

Show/Hide Visual Studio info
=== Visual Studio Community 2019 for Mac (Preview) ===

Version 8.9 Preview (8.9 build 1451)
Installation UUID: 8638f650-08a3-4c70-a782-75ebde1a24bc
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000113

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.113 (2020-02/4fdfb5b1fd5) (64-bit)
	Package version: 612000113

=== Xamarin Designer ===

Version: 16.9.0.266
Hash: c4842c761
Branch: remotes/origin/c4842c761b9b6a95407f72278ca7fb42f8f7fdf0
Build date: 2021-01-07 06:17:08 UTC

=== Roslyn (Language Service) ===

3.9.0-3.20619.14+df59a33fd9beff9790e01a2a1ab21e4a1e6921b3

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.102/Sdks
SDK Versions:
	5.0.102
	5.0.101
	5.0.100
	3.1.405
	3.1.404
	3.1.403
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.2
	5.0.1
	5.0.0
	3.1.11
	3.1.10
	3.1.9

=== .NET Core 3.1 SDK ===

SDK: 3.1.405

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.2 (17535)
Build 12B45b

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 14.9.0.27 (Visual Studio Community)
Hash: f4c9327fa
Branch: main
Build date: 2020-11-19 10:57:31-0500

=== Xamarin.Android ===

Version: 11.2.0.0 (Visual Studio Community)
Commit: xamarin-android/d16-9/f908d16
Android SDK: /Users/tommikiviniemi/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 30.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-9@1d382be
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.32.2@cfe06e0
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@ad80a42

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/tommikiviniemi/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.9.0.21
Hash: 57e40ba
Branch: remotes/origin/main
Build date: 2021-01-08 01:57:14 UTC

=== Android Device Manager ===

Version: 16.9.0.14
Hash: 0fdccda
Branch: remotes/origin/main
Build date: 2021-01-08 01:57:36 UTC

=== Build Information ===

Release ID: 809001451
Git revision: cfd15313a6388ef8dada0182e22a058131c46f9d
Build date: 2021-01-15 08:42:21-05
Build branch: release-8.9
Xamarin extensions: cfd15313a6388ef8dada0182e22a058131c46f9d

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.2.0 Darwin Kernel Version 20.2.0
    Wed Dec  2 20:39:59 PST 2020
    root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64

Screenshots

Reproduction Link

CollectionViewSelectionIssue.zip

@Tommigun1980
Copy link
Author

@jsuarezruiz @hartez I'd really appreciate some correspondence on these four CollectionView bugs I have opened:
#13592, #13547, #13548, #13231.

I spent a ton of time isolating the issues and making repro projects for them, and I need some kind of resolution as I have a hard time finish up my work here before they are resolved. So I'd really appreciate some comments on time estimates, or any kind of correspondence regarding them.
Thank you.

@Tommigun1980
Copy link
Author

Tommigun1980 commented Mar 2, 2021

Hi guys. Any chance the initial selection could be fixed?
It’s really hard to write apps when you can’t control the initial selection.
I’d be very happy if a fix materialized.

Thanks!

@Tommigun1980
Copy link
Author

@hartez @jsuarezruiz Hi. Do you guys think that initial selection could be fixed in CollectionViews? This is holding back a ton of stuff in my application. It's VERY VERY hard to write applications currently when you can't control list selections. Please!!!

Thank you.

@Tommigun1980
Copy link
Author

@hartez @jsuarezruiz Hi. I don't think I can finish my application unless initial selection is fixed for the CollectionView. Selection is an important concept and I don't think one can make apps without it working. Any chance this could get fixed? Let me know if something is not clear in the repro project. Thank you.

@Tommigun1980
Copy link
Author

Hi @hartez and @jsuarezruiz! Is there any chance this could get fixed at some point?
It is almost impossible to release an app using a CollectionView as selection doesn't work.
I have provided a repro project, videos, screenshots and an analysis of each problem.
Please let me know what more I could do to get this fixed?

Thank you!

@Tommigun1980
Copy link
Author

@hartez @jsuarezruiz Pinging about this yet again. The CollectionView's initial selection doesn't work so it's not really usable atm. Is there any chance you guys could fix this? This is an absolute blocker for me and probably quite a lot of other people. Selecting stuff in a CollectionView is a core feature.

Thank you!

@JunkyXL86
Copy link

Experiencing same problems.
@Tommigun1980 Keep in mind, you're not the only one having issues. They're not going to fix anything especially for you and your app.

Let's hope .NET MAUI fixes all kinds of those dumb bugs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants