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

SwipeGesture is not working on a listview #16624

Open
Tracked by #8895
Symbai opened this issue Aug 9, 2023 · 14 comments
Open
Tracked by #8895

SwipeGesture is not working on a listview #16624

Symbai opened this issue Aug 9, 2023 · 14 comments
Labels
area-controls-listview ListView and TableView area-gestures Gesture types 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

@Symbai
Copy link
Contributor

Symbai commented Aug 9, 2023

Description

Related to #8895 I still have the issue for more than 1 year where SwipeGesture is not working on a listview. My goal is that a user can swipe to the left and the swipe event should be raised. But I can swipe as many times as I want, nothing happens. The swipe event is never raised.

Steps to Reproduce

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="MauiApp1.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:MauiApp1">

    <ListView ItemsSource="{Binding Source={x:Static local:Bla.Instance}, Path=Items}">
        <ListView.GestureRecognizers>
            <SwipeGestureRecognizer Direction="Left" Swiped="SwipeGestureRecognizer_Swiped" />
        </ListView.GestureRecognizers>
    </ListView>

</ContentPage>
using System.Collections.ObjectModel;

namespace MauiApp1
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void SwipeGestureRecognizer_Swiped(object sender, SwipedEventArgs e)
        {
            var s = string.Empty; //Set a breakpoint on this line and it never get hit or do something else, still event is never raised
        }
    }

    public class Bla
    {
        public static Bla Instance { get; } = new Bla();

        public Bla()
        {
            for (int i = 0; i < 20; i++)
            {
                Items.Add($"Item {i}");
            }
        }

        public ObservableCollection<string> Items { get; } = new ObservableCollection<string>();

    }

}

Link to public reproduction project repository

Yes

Version with bug

7.0.49 (Edit: 01/02/2024 still bugged)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Pixel 5 - API 31

Did you find any workaround?

No response

Relevant log output

No response

@Symbai Symbai added the t/bug Something isn't working label Aug 9, 2023
@PureWeen PureWeen added this to the Backlog milestone Aug 9, 2023
@ghost
Copy link

ghost commented Aug 9, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@ghost
Copy link

ghost commented Aug 14, 2023

Same issue with any scrollable view like CollectionView. See below Screencast and according sample code here
Related to: #7403

issue_scrollableview_no_lef_right_swipe

@GitOguz
Copy link

GitOguz commented Aug 15, 2023

nvm

@ghost
Copy link

ghost commented Aug 15, 2023

@GitOguz You confuse SwipeView with SwipeGestureRecognizer which are different things!

@GitOguz
Copy link

GitOguz commented Aug 15, 2023

Oh sorry, I've read it wrong.

@homeyf homeyf added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Jan 2, 2024
@ghost
Copy link

ghost commented Jan 2, 2024

Hi @Symbai. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Symbai
Copy link
Contributor Author

Symbai commented Jan 2, 2024

Not repro on windows platform with sample project.

That's a lie. Here is a video showing this issue STILL exist. Same version, same platform, still same project.

bandicam.2024-01-02.09-29-27-046.mp4

Even with simplified XAML the issue still exist:

bandicam.2024-01-02.09-32-44-600.mp4

@ghost ghost removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Jan 2, 2024
@AlleSchonWeg
Copy link
Contributor

@Symbai
You test it on the android platform.

@homeyf homeyf added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Jan 2, 2024
@ghost
Copy link

ghost commented Jan 2, 2024

Hi @Symbai. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@homeyf homeyf added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Jan 2, 2024
@Symbai
Copy link
Contributor Author

Symbai commented Jan 2, 2024

@Symbai You test it on the android platform.

If you can read the FIRST post, I reported it doesnt work on Android.

@AlleSchonWeg
Copy link
Contributor

@Symbai You test it on the android platform.

If you can read the FIRST post, I reported it doesnt work on Android.

Yes, i read it. And you wrote:

Not repro on windows platform with sample project.

That's a lie. Here is a video showing this issue STILL exist. Same version, same platform, still same project.

Why is "Not repro on windows platform with sample project." a lie? Your video only shows android platform. Do you test it also on windows platform?

@Symbai
Copy link
Contributor Author

Symbai commented Jan 2, 2024

Because "on windows platform" could also means running the Android emulator on windows like I did in my video. Also because in first post I mentioned it happens on Android. Now do me a favor and stop this offtopic discussion as it doesn't add anything useful to this topic. Thanks for your understanding.

@BeepBeepBopBop
Copy link

Hello, I am also stuck with GestureRecognizer issues on Android. I am trying several options but even the most basic like creating a BoxView and attaching a SwipeGestureRecognizer does not work at all. Does anybody have a workaround to use GestureRecognizer on Android or an idea of when we could hope to use them ? Thanks a lot for any help.

@L3mur1
Copy link

L3mur1 commented Dec 4, 2024

Hi, I see this issue is open for some time.
Any chance of fixing swipe gesture events to be listened on listview with swipe gesture recogniser on android?
Still no known workarounds?

for me its not working on .net8
Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-listview ListView and TableView area-gestures Gesture types 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

8 participants