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

Initially selected item in CollectionView isn't highlighted on iOS #14730

Closed
fischberg opened this issue Apr 24, 2023 · 2 comments
Closed

Initially selected item in CollectionView isn't highlighted on iOS #14730

fischberg opened this issue Apr 24, 2023 · 2 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/iOS 🍎 s/duplicate 2️⃣ This issue or pull request already exists t/bug Something isn't working

Comments

@fischberg
Copy link

Description

When the SelectedItem property in a CollectionView is defined before it is rendered, the SelectedItem isn't highlighted in the CollectionView in iOS when the CollectionView is first rendered. If I create a List of items, define a "Selected" property to point to one of those items then, bind the CollectionView's "SelectedItem" property to the "Selected" property, the item contained in "SelectedItem" is not highlighted when the List of items is rendered in the CollectionView. If I click on any item in the CollectionView, it becomes highlighted.

The code referenced in this report shows that the Selected property is set prior to the initial rendering of the the CollectionView, however, the SelectedItem isn't highlighted on iOS (it works on Android).

I attached a screenshot of an iPhone emulator demonstrating the problem.

Screenshot 2023-04-23 at 7 10 32 PM

Steps to Reproduce

When the app is started, item "2", is selected programmatically as shown in the text "This is he selected item: 2". However, item "2" isn't highlighted in the rendered CollectionView of items "1 2 3". If you click on any item, you'll see it is highlighted and the text below it shows the correct highlighted item.

Link to public reproduction project repository

https://github.com/fischberg/CollectionViewRepro

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.2

Did you find any workaround?

No

Relevant log output

No response

@fischberg fischberg added the t/bug Something isn't working label Apr 24, 2023
@drasticactions
Copy link
Contributor

drasticactions commented Apr 24, 2023

Duplicate of #14535

The way of interacting with it is different, but the underlying cause, IMO, is the same.

@samhouts
Copy link
Member

Duplicate of #14535

@samhouts samhouts marked this as a duplicate of #14535 May 10, 2023
@samhouts samhouts added the s/duplicate 2️⃣ This issue or pull request already exists label May 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2023
@samhouts samhouts added platform/iOS 🍎 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/iOS 🍎 s/duplicate 2️⃣ This issue or pull request already exists t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants