-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[iOS] Fix for Left SwipeView Items Conflict with Shell Menu Swipe Gesture #26976
base: main
Are you sure you want to change the base?
[iOS] Fix for Left SwipeView Items Conflict with Shell Menu Swipe Gesture #26976
Conversation
Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
// TODO MAUI | ||
//if (view is SwipeView) | ||
//return true; | ||
if (view is MauiSwipeView) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Xamarin.Forms, the SwipeViewRenderer manage this cases, enabling/disabling parent gestures while the SwipeView is capturing the touch events https://github.com/xamarin/Xamarin.Forms/blob/2f8f4864a4d289dc89a6228e2ca9d6a49993e365/Xamarin.Forms.Platform.Android/Renderers/SwipeViewRenderer.cs#L1508
Could review it, and apply a similar approach with the handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz, I have resolved the issue where the Shell flyout gesture intercepts the SwipeView gesture on iOS. However, it seems the provided code reference to Xamarin.Forms on Android.
Upon reviewing the Xamarin.Forms implementation for iOS in the SwipeViewRenderer, I observed the relevant logic:
https://github.com/xamarin/Xamarin.Forms/blob/5.0.0/Xamarin.Forms.Platform.iOS/Renderers/SwipeViewRenderer.cs#L851
A similar approach has already been included into .NET MAUI within MauiSwipeView.iOS (the platformView of SwipeView on iOS):
https://github.com/dotnet/maui/blob/main/src/Core/src/Platform/iOS/MauiSwipeView.cs#L516
The fix I implemented is based on the ShellFlyoutRenderer logic in Xamarin.Forms:
https://github.com/xamarin/Xamarin.Forms/blob/2f8f4864a4d289dc89a6228e2ca9d6a49993e365/Xamarin.Forms.Platform.iOS/Renderers/ShellFlyoutRenderer.cs
However, I noticed that the equivalent logic is currently absent in the ShellFlyoutRenderer implementation for iOS in .NET MAUI.
Root Cause of the issue
Description of Change
Issues Fixed
Fixes #26933
Tested the behaviour in the following platforms
Screenshot
SwipeViewIssue.mov
SwipeViewFix.mov
Reference from Xamarin
https://github.com/xamarin/Xamarin.Forms/blob/2f8f4864a4d289dc89a6228e2ca9d6a49993e365/Xamarin.Forms.Platform.iOS/Renderers/ShellFlyoutRenderer.cs#L85