-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
SwipeGestureRecognizer does not raise Swiped event #16203
Comments
@MrThree12, I am having the same problem. I am seeing this in the output whenever I attempt a swipe:
|
I tested on iPhone as well with no success. There is no message in the output either. |
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. |
Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). Repro on Android 14.0-API34, not repro on Windows 11 with below Project: |
This could be related to scroll views; for example the following results in the swipe gesture working, but scrolling breaks; <AbsoluteLayout Background="CornflowerBlue">
<ScrollView AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="SizeProportional">
<ScrollView.GestureRecognizers>
<!-- These gestures work, but scrolling does not! -->
<SwipeGestureRecognizer Swiped="SwipeGestureRecognizer_Swiped" Threshold="50" Direction="Left" />
<SwipeGestureRecognizer Swiped="SwipeGestureRecognizer_Swiped" Threshold="50" Direction="Right" />
</ScrollView.GestureRecognizers>
<VerticalStackLayout>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="ZZZ" FontSize="30"/>
</VerticalStackLayout>
</ScrollView>
</AbsoluteLayout> If you move the gesture recognizer to the layout, the scrolling works but the swiping doesn't. It's like only one component in the mounted hierarchy can handle gestures, on iOS this is not a problem. <AbsoluteLayout Background="CornflowerBlue">
<AbsoluteLayout.GestureRecognizers>
<!-- These gestures are ignored, but user can scroll. -->
<SwipeGestureRecognizer Swiped="SwipeGestureRecognizer_Swiped" Threshold="50" Direction="Left" />
<SwipeGestureRecognizer Swiped="SwipeGestureRecognizer_Swiped" Threshold="50" Direction="Right" />
</AbsoluteLayout.GestureRecognizers>
<ScrollView AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="SizeProportional">
<VerticalStackLayout>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="Welcome to .NET MAUI!" FontSize="30"/>
<Label Text="ZZZ" FontSize="30"/>
</VerticalStackLayout>
</ScrollView>
</AbsoluteLayout> Seems there is no winning!! :( |
Description
Adding SwipeGestureRecognizer to Button (Label or Border or FlexLayout) does not raise Swiped event. Also on Android it "overrides" Clicked event in button "properties" (when clicked it does not fire Clicked event), but it does not "override" on Windows (when clicked it fires Clicked event).
Steps to Reproduce
Create new MAUI project.
Update Button in MainPage.xaml:
In MainPage.xaml.cs add event:
Link to public reproduction project repository
https://github.com/MrThree12/mauiswipebug
Version with bug
7.0.86
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 13 – API 33, Windows 10 – 10.0.19045
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: