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

Moving Items between groups of a Grouped CollectionView in Android throws a IndexOutOfBoundsException #23138

Closed
inimirpaz opened this issue Jun 19, 2024 · 3 comments · Fixed by #24461
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView fixed-in-8.0.90 fixed-in-9.0.0-rc.2.24503.2 i/regression This issue described a confirmed regression on a currently supported version migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@inimirpaz
Copy link

inimirpaz commented Jun 19, 2024

Description

See repro. When moving items back and forth in a grouped collectioview in Android a

Java.Lang.IndexOutOfBoundsException has been thrown
Inconsistency detected. Invalid view holder adapter positionTemplatedItemViewHolder{aaacc96 position=7 id=-1, oldPos=5, pLpos:5 scrap [attachedScrap] tmpDetached no parent} crc645d80431ce5f73f11.MauiRecyclerView_3{5d3c385 VFED..... ......I. 0,0-1080,1584}, adapter:crc645d80431ce5f73f11.ReorderableItemsViewAdapter_2@d202cd7, layout:androidx.recyclerview.widget.LinearLayoutManager@c6597f5, context:crc64dcdaa62ceb4aad7f.MainActivity@29e59f2

is thrown.

Steps to Reproduce

In the repro, try to tap on the elements which are moved to the newly created "bucket" group. Then from the "bucket" group try to tap once again to move them back, and the crash should be triggered.

Link to public reproduction project repository

https://github.com/inimirpaz/maui_issues/tree/grouped_cv_issue

Version with bug

8.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

8.0.3

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@inimirpaz inimirpaz added the t/bug Something isn't working label Jun 19, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed i/regression This issue described a confirmed regression on a currently supported version labels Jun 20, 2024
@ninachen03
Copy link

ninachen03 commented Jun 20, 2024

I can repro this issue on Visual Studio 17.11.0 Preview 2.0 (8.0.60 &8.0.21 ), but it doesn't repro on 8.0.3
image

@inimirpaz
Copy link
Author

Possible workaround: add an empty group at the end.

@samhouts samhouts added platform/android 🤖 migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jun 26, 2024
@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@PureWeen PureWeen added this to the .NET 8 SR9 milestone Aug 9, 2024
@PureWeen PureWeen added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Aug 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 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 fixed-in-8.0.90 fixed-in-9.0.0-rc.2.24503.2 i/regression This issue described a confirmed regression on a currently supported version migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants