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] Avoid crash adding items to ObservableCollection #21613

Closed
wants to merge 4 commits into from

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Avoid crash adding items to ObservableCollection.

Issues Fixed

Fixes #21374

@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/iOS 🍎 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Apr 3, 2024
try
{
// We only have to do this on older iOS versions; sometimes when removing a cell that's right at the edge
// of the viewport we'll run into a race condition where the invalidation context will have the removed
// indexpath. And then things crash. So

var defaultContext = base.GetInvalidationContext(preferredAttributes, originalAttributes);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigating why null is returned in unexpected cases (the cell is visible).

Copy link
Contributor Author

@jsuarezruiz jsuarezruiz Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @PureWeen
Related to #21606

@PureWeen PureWeen closed this Apr 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 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 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when adding to ObservableCollection
2 participants