Xamarin.forms: [Bug][ListView][Android] Some scroll inputs are ignored

Created on 31 Jul 2019  路  13Comments  路  Source: xamarin/Xamarin.Forms

Description

On android some scroll gestures on ListViews are ignored. It is very unpleasant to use a longer list. See Sample for current behavior.

On iOS everything works fine.
It occurs with all caching strategies and with and without group headers.

Steps to Reproduce

  1. Large List to fill multiple times a screen (in my example it was about 100 items)
  2. Scroll to the middle --> start fast scrolling

Expected Behavior

Fast response for all scroll gestures

Actual Behavior

Some scroll gestures are ignored and must be done multiple times for scrolling.

Basic Information

  • Version with issue: 4.1
  • Last known good version:3.6
  • Platform Target Frameworks:

    • Android min version: 5.0

    • Android target version: 9.0

Video

Sample

4.1.0 gestures 馃枛 listview 5 regression high impact Android bug

Most helpful comment

I have recreated a little sample project, but I can't seem to reproduce that behavior. Maybe there is some other layout element together with this that is causing trouble.

I have this bug too. Try to set IsPullToRefreshEnabled = true.
I fix this issue in my ListViewRenderer:

    protected override void OnElementChanged(ElementChangedEventArgs<ListView> e)
    {
        base.OnElementChanged(e);
        if (Control != null)
        {
            Control.NestedScrollingEnabled = false;
        }
    }

All 13 comments

HI @Huaba93, thanks for reporting the issue!

I have recreated a little sample project, but I can't seem to reproduce that behavior. Maybe there is some other layout element together with this that is causing trouble.

Would you be able to try this project and see if it happens with this one as well? If it does not, could you please try to create a project that resembles the one you are showing in the video?

Repro7029.zip

Thanks!

I have recreated a little sample project, but I can't seem to reproduce that behavior. Maybe there is some other layout element together with this that is causing trouble.

I have this bug too. Try to set IsPullToRefreshEnabled = true.
I fix this issue in my ListViewRenderer:

    protected override void OnElementChanged(ElementChangedEventArgs<ListView> e)
    {
        base.OnElementChanged(e);
        if (Control != null)
        {
            Control.NestedScrollingEnabled = false;
        }
    }

Thanks @inickvel!

I do see a little bit of lagging when I enable that, but still nothing like the original issue. @Huaba93 can you confirm that you have pull to refresh enabled? Does it work better when you disable it?

@jfversluis your sample works fine.

Yes pull to refresh is enabled.
full listview settings:
<ListView IsGroupingEnabled="True" IsPullToRefreshEnabled="True" HasUnevenRows="false" SeparatorVisibility="None" ItemsSource="{Binding CampaignEntriesGroupModels}" RowHeight="90" BackgroundColor="White" SelectionMode="None" RefreshCommand="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}">

and I use prisms event to command behavior

<ListView.Behaviors> <behaviors:EventToCommandBehavior EventName="ItemTapped" Command="{Binding ItemTappedCommand}" EventArgsParameterPath="Item" /> </ListView.Behaviors>

I am currently trying to create a simple example where the error also occurs. At the moment I am not successful :/

@jfversluis ok i got it. I am using Xamarin.Forms 4.1.0.581479 and with this version i can reproduce it. It occurs only when pull to refresh is enabled.
I can also reproduce it with Xamarin.Forms 4.2.0.618605-pre2

    <StackLayout>
        <ListView ItemsSource="{Binding Items}" IsPullToRefreshEnabled="True">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                       <Label Text="{Binding .}"></Label>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </StackLayout>

Repro7029.zip

Bingo! I see it happening now as well. Thanks for the cooperation :)

We are having the same issue with one of our apps. Are there any mitigation strategies available to prevent this issue from occurring unless an official fix is been provided?

We are having the same issue with one of our apps. Are there any mitigation strategies available to prevent this issue from occurring unless an official fix is been provided?

I would also be interested in getting to know a fix.

We need to have lists with pull to refresh enabled. So disabling pull to refresh at all might not be a suitable solution :-(

I can also confirm this issue.
Is this issue completely ignored? I don't see any activity for the last 28 days.

@jemunk this issue is definitely not completely ignored and I'm sorry you feel that way. Unfortunately, I don't have an exact timeline for you at this point, but this issue is not forgotten

I was able to workaround this issue by setting IsPullToRefreshEnabled to false when the first item of the ListView dissapears from the screen, and enabling it back when the first item appears again.

ItemAppearing += (sender, args) => { if (args.ItemIndex == 0) { IsPullToRefreshEnabled = true; } }; ItemDisappearing += (sender, args) => { if (args.ItemIndex == 0) { IsPullToRefreshEnabled = false; } };

We are having the same issue with our App as well. Is there any SLA?

Hello guys. Any news?

Was this page helpful?
0 / 5 - 0 ratings