Skip to content

CollectionView on android in tab view and shell tabs does not clear when refreshing items bound to ItemsSource #117

@jjelecondev

Description

@jjelecondev
  • OS: Android
  • Device: Pixel 4/5 (confirmed) but assuming others
  • Sdk vervion: [Android 13/API 34]
  • Maui with .net 8

Describe the bug
When CollectionView is displayed the first time, a ObservableCollection.Clear() followed by adding new items to the collection results in the view correctly refreshing. If the user navigates to another page in the tab view then back, the same action will cause the new items to prepend in the list and the "cleared" items never clear. We have found a similar problem with drop no longer working when navigating away and back.

In the attached repository, we are using multiple DataTemplates with a TemplateSelector.

To Reproduce

  1. run the example on android,
  2. navigate to page 2
  3. then back to page 1
  4. swipe down to refresh.

Exceptions (if applicable)
None found. Just doesn't clear old items

Screenshots (if applicable)
If applicable, add screenshots to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions