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

[iOS] Fix for Left SwipeView Items Conflict with Shell Menu Swipe Gesture #26976

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Tamilarasan-Paranthaman
Copy link
Contributor

Root Cause of the issue

  • When swiping to the left in the SwipeView, the shell flyout gesture intercepts the SwipeView gesture and causes the shell flyout to open.

Description of Change

  • I resolved the issue by identifying if the view is a MauiSwipeView. If it is, I restricted the touch interaction in the shell flyout, allowing the SwipeView touch gestures to work as expected.

Issues Fixed

Fixes #26933

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
SwipeViewIssue.mov
SwipeViewFix.mov

Reference from Xamarin

https://github.com/xamarin/Xamarin.Forms/blob/2f8f4864a4d289dc89a6228e2ca9d6a49993e365/Xamarin.Forms.Platform.iOS/Renderers/ShellFlyoutRenderer.cs#L85

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 7, 2025
Copy link
Contributor

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.

@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 7, 2025
@rmarinho
Copy link
Member

rmarinho commented Jan 7, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review January 7, 2025 13:28
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner January 7, 2025 13:28
@jfversluis jfversluis added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Jan 9, 2025
// TODO MAUI
//if (view is SwipeView)
//return true;
if (view is MauiSwipeView)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left SwipeView Items Conflict with Shell Menu Swipe Gesture on iOS
5 participants