Bug 45351 - TapGestureRecognizer blocks underlying PanGestureRecognizer
Summary: TapGestureRecognizer blocks underlying PanGestureRecognizer
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-13 10:40 UTC by Dominik Rupp
Modified: 2017-06-22 01:57 UTC (History)
3 users (show)

Tags: Android ac
Is this bug a regression?: ---
Last known good build:


Attachments
Repro project (282.42 KB, application/x-zip-compressed)
2016-10-24 15:50 UTC, E.Z. Hart [MSFT]
Details
Pan and Tap defined on a frame (333.77 KB, application/x-zip-compressed)
2017-04-03 19:12 UTC, Brian Erickson
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 45351 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Dominik Rupp 2016-10-13 10:40:14 UTC
Consider the following Layout that works in iOS and UWP:

<StackLayout VerticalOptions="Center" HorizontalOptions="Center">

    <StackLayout.GestureRecognizers>
      <PanGestureRecognizer PanUpdated="PanGestureRecognizer_OnPanUpdated" />
      
    </StackLayout.GestureRecognizers>

    <Label Text="Test" x:Name="Label">
      <Label.GestureRecognizers>
        <TapGestureRecognizer Command="{Binding TestCommand}" />
      </Label.GestureRecognizers>
    </Label>

</StackLayout>

The Label is bound to a Command that only executes a Debug.WriteLine("Tapped").

While in iOS and UWP I can tap the label AND pan the underlying StackLayout, in Android the tap seems to absorb the event so it is not forwarded to the underlying container.
Comment 1 E.Z. Hart [MSFT] 2016-10-24 15:50:00 UTC
Created attachment 18193 [details]
Repro project
Comment 2 Brian Erickson 2017-04-03 19:11:52 UTC
Also consider the following case:
   <Frame x:Name="outerFrame" Padding="10, 50, 10, 0" OutlineColor="Red">
      <Frame.GestureRecognizers>
         <TapGestureRecognizer Tapped="onTap" />
         <PanGestureRecognizer PanUpdated="OnPanUpdated" />
      </Frame.GestureRecognizers>

      <StackLayout Margin="50,50,0,0" Spacing="20">
         <Label x:Name="myTapLabel"  Text="Tap Count: 0"></Label>
         <Label x:Name="myPanLabel"  Text="Pan Complete Count: 0"></Label>
      </StackLayout>
   </Frame>

On UWP tap works normally buy it's difficult(impossible) to get the pan gesture to complete.  Also can only tap on the labels.

On Android the tap works normally.  Pan fires both pan and tap.  I can pan or tap anywhere on the screen.

Another repro project attached...
Comment 3 Brian Erickson 2017-04-03 19:12:32 UTC
Created attachment 21160 [details]
Pan and Tap defined on a frame