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

CacheKeyFactory used in a CollectionView causes incorrect images to load. #1560

Open
AdamEssenmacher opened this issue Mar 17, 2022 · 0 comments

Comments

@AdamEssenmacher
Copy link

🐛 Bug Report

Using a CacheKeyFactory on images rendering inside a CollectionVIew (or other collection using recycling / virtualization) can cause incorrect images to load.

Expected behavior

Correct images always load when using a CacheKeyFactory

Reproduction steps

Use a CacheKeyFactory within a CollectionView's DataTemplate like:

                <CollectionView ItemsSource="{Binding Items}">
                    <CollectionView.ItemTemplate>
                        <DataTemplate x:DataType="viewModels:MyViewModel">
                            <ffimage:CachedImage Source="{Binding ImageUrl}">
                                <ffimage:CachedImage.CacheKeyFactory>
                                    <ui:MyCacheKeyFactory />
                                </ffimage:CachedImage.CacheKeyFactory>
                            </ffimage:CachedImage>
                        </DataTemplate>
                    </CollectionView.ItemTemplate>
                </CollectionView>

Load the collection up with enough items (with unique images) to require scrolling. Scroll and you should notice that sometimes an incorrect image is displayed.

I saw this using Xamarin.Forms on iOS. Not sure about Android.

Configuration

Version: 2.4.11.982

Platform:

  • [ x] 📱 iOS
  • [ ?] 🤖 Android
  • [ ?] 🏁 WPF
  • [ ?] 🌎 UWP
  • [ ?] 🍎 MacOS
  • [ ?] 📺 tvOS
  • [ x] 🐒 Xamarin.Forms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant