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

SwipeView in CollectionView misses binding when deleting an item after swiping open multiple items #21958

Open
Equabyte opened this issue Apr 20, 2024 · 4 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView 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

@Equabyte
Copy link

Equabyte commented Apr 20, 2024

Description

SwipeView is typically used inside a CollectionView to provide an option to delete a collection view item (e.g. by revealing a trash can icon swipe item and using Command binding to remove the corresponding item when clicked). When multiple items of the collection view are swipe open, deleting any of the swiped items different from the bottom one causes a refresh of the CollectionView with unexpected side effects: this refresh is not supposed to alter in any way the SwipeView open state of the other collection view items (which should stay open), but in fact the SwipeView of all items following the deleted one is getting closed. Deleting further items later on will present other erratic behavior like e.g. some SwipeViews will show open again but on unexpected CollectionView items.

Steps to Reproduce

  1. Create a MAUI project with one page where a CollectionView embeds a SwipeView that can be used to delete any of its items through an appropriately bound custom Command;
  2. populate the CollectionView with, say, 10 items; run the app on Android and swipe open three or more of the CollectionView items, revealing the deletion option of your SwipeView;
  3. delete the top item or any of the middle items for which you opened the SwipeView and observe the behavior.

Desired result: every time you delete an item by clicking the SwipeView "delete" option, the corresponding item should be removed from the CollectionView, the CollectionView should be refreshed and all other open SwipeViews should stay open.

Error result: the SwipeView of the CollectionView items following the deleted item is getting closed.

Link to public reproduction project repository

https://github.com/Equabyte/MAUI_SwipeView_Error

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 14 (SDK34)

Did you find any workaround?

Not yet.

Relevant log output

No response

@Equabyte Equabyte added the t/bug Something isn't working label Apr 20, 2024
@Equabyte
Copy link
Author

Short video showing the issue on production app:
https://github.com/dotnet/maui/assets/145383043/d91616fe-364c-497a-99c5-3bf891f8093a

@Equabyte
Copy link
Author

Added link to repro project.
https://github.com/Equabyte/MAUI_SwipeView_Error

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 25, 2024
@kevinxufei
Copy link

Verified this issue with Visual Studio 17.10.0 Preview 5 (8.0.14/8.0.21). Can repro it on android platform.

@Equabyte
Copy link
Author

Any chance to include in SR7 ?

@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
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/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants