Skip to content

Conversation

KishoreJey
Copy link
Collaborator

@KishoreJey KishoreJey commented Oct 6, 2025

Root Cause of the Issue

The SfTabView's internal gesture handling interferes with the DrawingView's touch processing. Specifically, the tab view's gesture recognizer prematurely cancels the touch event, causing the DrawingView to interpret the interaction as cancelled rather than completed. This happens because the tab view's gesture listener (ITapGestureListener) does not differentiate between general views and specialized touch-sensitive views like DrawingView.

Description of Change

Added a type check in the ShouldHandleTap method of SfTabView's horizontal content iOS class to detect if the touched view is a MauiDrawingView. If so, the tab view disables its own touch processing to allow the DrawingView to handle the gesture correctly.

Issues Fixed

Issue : #258

@PaulAndersonS PaulAndersonS requested a review from Copilot October 13, 2025 09:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a gesture handling conflict between SfTabView and DrawingView on iOS. The issue occurred because SfTabView's gesture recognizer was interfering with DrawingView's touch processing, causing drawing gestures to be cancelled prematurely.

  • Added type checking to detect MauiDrawingView instances in touch events
  • Disabled SfTabView's touch processing when DrawingView is being interacted with

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +79 to +80
var touchViewType = touchView?.GetType().FullName;
if (touchViewType != null && touchViewType.Contains("CommunityToolkit.Maui.Core.Views.MauiDrawingView", StringComparison.Ordinal))
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using string-based type checking with Contains is fragile and could match unintended types. Consider using a more robust approach like is pattern matching or checking if the type implements a specific interface.

Copilot uses AI. Check for mistakes.

this._canProcessTouch = true;

var touchViewType = touchView?.GetType().FullName;
if (touchViewType != null && touchViewType.Contains("CommunityToolkit.Maui.Core.Views.MauiDrawingView", StringComparison.Ordinal))
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded type name string creates a tight coupling to the CommunityToolkit implementation. Consider defining a constant for this type name or using reflection to get the type more reliably.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant