Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Selected items are not highlighted in the UI during the initial loading when using MultiSelection in the CollectionView. #26943

Open
LogishaSelvarajSF4525 opened this issue Jan 3, 2025 · 4 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/iOS 🍎 t/bug Something isn't working
Milestone

Comments

@LogishaSelvarajSF4525
Copy link
Contributor

Description

In .NET MAUI, on the iOS platform, when the CollectionView is initialized with Items 1 and Items 2 pre-selected, the selection is applied in the model, but these items are not visually highlighted with a background color to indicate they are selected.

Note: Since this issue has not been reproduced in either the sandbox sample or the HostApp sample, the initial case is working properly. However, when dynamically clearing and adding selected items, the selection is not reflected in the UI on iOS.

While addressing this issue, please enable the test case: CollectionViewUITests.MultipleBoundSelection, and ensure that all scenarios work as expected.

In iOS,

Screen.Recording.2025-01-03.at.4.53.26.PM.mov

In android,

Screen.Recording.2025-01-03.at.4.26.44.PM.mov

Steps to Reproduce

  1. Run the app on an iOS device or simulator.MultipleBoundsSample.zip
  2. Ensure that the CollectionView is loaded on the screen with a list of items.
  3. In the view model, the SelectedItems collection is populated with items 1 and 2.
  4. The CollectionView is set to SelectionMode="Multiple", and Items 1 and Item2 are pre-selected programmatically.
  5. Observe that the SelectedItems collection contains the correct items (Item 1 and Item 2).
  6. However, visually, the background color of the pre-selected items (items 1 and 2) does not change to indicate selection, and there is no visual highlight, even though the items are marked as selected in the model.

Expected Behavior:
When Items 1 and Items 2 are pre-selected in the CollectionView, they should appear visually highlighted, with their background color changed to indicate their selected state.

Actual Behavior:
Items 1 and Items 2 are pre-selected, but they do not visually appear highlighted with a background color.

Link to public reproduction project repository

No response

Version with bug

9.0.21 SR2.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

9.0.21 SR2.1

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

@LogishaSelvarajSF4525 LogishaSelvarajSF4525 added the t/bug Something isn't working label Jan 3, 2025
Copy link

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.

@LogishaSelvarajSF4525 LogishaSelvarajSF4525 changed the title [iOS] No Visual Highlight for Pre-selected Items in CollectionView [iOS] Selected items are not highlighted in the UI during the initial loading when using MultiSelection in the CollectionView. Jan 3, 2025
@karthikraja-arumugam
Copy link
Contributor

It looks similar to this #8435

@mattleibow mattleibow added platform/iOS 🍎 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Jan 4, 2025
@mattleibow mattleibow added this to the Backlog milestone Jan 4, 2025
@mattleibow
Copy link
Member

As OP points out, we have a test but it was disabled: Image

[FailsOnAllPlatformsWhenRunningOnXamarinUITest("Click does not find CollectionView elements.")]

@mattleibow
Copy link
Member

It is likely related to or a duplicate of #15718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants