Skip to content

CollectionView snaps on scroll although snapping is disabled #18367

Description

@Raffro

Description

I am using Maui 7.0.92 on Android (Emulator and local device Galaxy S20FE)

My Viewlayout is the following:
ContentPage
RefreshView
Grid (no further definitions in grid)
CollectionView

The Collection looks like this. If you add some items you will see the items snap on scrolling, although snapping is disabled...

<CollectionView Margin="5"

                        SelectionMode="None">
          <CollectionView.ItemsLayout>
            <LinearItemsLayout Orientation="Vertical"
                               ItemSpacing="5"
                               SnapPointsType="None"
                               SnapPointsAlignment="Center" />
          </CollectionView.ItemsLayout>
          <CollectionView.ItemTemplate>
            <DataTemplate>
              <Border Padding="0"
                      HeightRequest="100"
                      StrokeThickness="1">
                <Border.StrokeShape>
                  <Rectangle RadiusX="30"
                             RadiusY="30" />
                </Border.StrokeShape>
                <Border.Shadow>
                  <Shadow Opacity="0.1" />
                </Border.Shadow>
              </Border>
            </DataTemplate>
          </CollectionView.ItemTemplate>
        </CollectionView>

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, iOs is not affected

Affected platform versions

Android emulator and local device (API 33)

Did you find any workaround?

no

Relevant log output

No response

Activity

  1. Raffro commented on Oct 30, 2023

    @Raffro
    Author

    EDIT: It seems that it only happen if the top element of the datatemplate is a border.

    if i put a grid or a stacklayout it doesnt happen.
    But if a border again is the first element in the stack or grid, it snaps again without that i define it.

    If the collectionview is put into a scrollview,, it doesn't auto snap anymore, but with scrollview, it scrolls laggy

  2. changed the title [-]CollecitionView snaps on scroll although snapping is disabled[/-] [+]CollectionView snaps on scroll although snapping is disabled[/+] on Oct 30, 2023
  3. mjsb212 commented on Nov 3, 2023

    @mjsb212

    I'm having a similar issue when using the GridItemsLayout tags in XAML - BUT if I remove the CollectionView.ItemsLayout and just use <CollectionView ItemsLayout="VerticalGrid, 3" /> which renders the same exact grid layout, there is no snapping issue on scroll. The following XAML is what causes my snapping issue: <CollectionView.ItemsLayout> <GridItemsLayout Orientation="Vertical" VerticalItemSpacing="5" HorizontalItemSpacing="5" SnapPointsType="None" Span="3"/> </CollectionView.ItemsLayout>

  4. added
    s/needs-reproAttach a solution or code which reproduces the issue
    on Nov 3, 2023
  5. ghost added on Nov 7, 2023
  6. Raffro commented on Nov 8, 2023

    @Raffro
    Author

    Hi, here is a simple project attached, where you can add elements to the collectionview per button click. you will see on android (e.g. API 33) that it snaps on scroll.

    @mjsb212 Thank you, your hint helped me a lot, I am using now
    <CollectionView ItemsLayout="VerticalList"/> and it works without snapping. Unfortunately I can not specify the itemspacing with that type of declaration. If I set the Itemspacing in the code-behind file via
    ((LinearItemsLayout)collV.ItemsLayout).ItemSpacing = 15;
    it is snapping again.
    Using the xaml declaration without ItemSpacing also prevents the snapping, so I assume the bug lies within the setting of the ItemSpacing Property. @mjsb212 FYI

    CollectionViewSnapTest.zip

  7. ghost added
    s/needs-attentionIssue has more information and needs another look
    on Nov 8, 2023
  8. ghost removed
    s/needs-reproAttach a solution or code which reproduces the issue
    on Nov 8, 2023
  9. ghost removed on Nov 8, 2023
  10. mjsb212 commented on Nov 10, 2023

    @mjsb212

    @Raffro I have also determined that setting the ItemSpacing property is what causes the "snapping" behavior - so the only workaround for now is to not set it until the bug is logged and fixed.

  11. 4 remaining items

  12. added this to the Backlog milestone on Jun 6, 2024
  13. osyyyS commented on Dec 6, 2025

    @osyyyS

    Still occurs in .NET 10 SR1 on Android Emulator API36 with VS2026

  14. Lucasian20 commented on Jan 31, 2026

    @Lucasian20

    Yep still has poor scrolling performance on android in .net10

  15. added a commit that references this issue on Mar 6, 2026
    061ec3e
  16. added 2 commits that reference this issue on Mar 14, 2026
    5f9a1e2
    d3ecf64
  17. added a commit that references this issue on Apr 8, 2026
  18. modified the milestones: Backlog, .NET 10 SR6 on Apr 29, 2026
  19. locked and limited conversation to collaborators on May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androids/needs-attentionIssue has more information and needs another looks/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions