Bug 27416 - Adding multiple TapGestureRecognizers with different NumberOfTaps does not work correctly via XAML
Summary: Adding multiple TapGestureRecognizers with different NumberOfTaps does not wo...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.4
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2015-02-25 10:46 UTC by John Miller [MSFT]
Modified: 2016-04-08 19:08 UTC (History)
7 users (show)

Tags: all functional AC
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (177.05 KB, application/zip)
2015-02-25 10:46 UTC, John Miller [MSFT]
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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description John Miller [MSFT] 2015-02-25 10:46:45 UTC
Created attachment 10027 [details]
Test Case

**Overview:**

   The attached sample demonstrates an issue when adding two TapGestureRecognizers to the same element (Label) in Xaml. The NumberOfTapsRequired for one label is "1" and the other is "2". When double-tapping the Label, the recognizer set with "1" fires twice. 

**Steps to Reproduce:**

   1. Run the attached sample and an iOS simulator.
   2. Double-click/tap the Label
   3. Observe the console output

**Actual Results:**

   The TapGestureRecognizer with a NumberOfTapsRequired set to "1" fires twice. The NumberOfTapsRequired set to "2" fires once. 
   A secondary issue is that tapping slowly on the label still causes the NumberOfTapsRequired = 2 recognizer to fire.

**Expected Results:**

   The TapGestureRecognizer with a NumberOfTapsRequired set to "1" should not fire at all on a double-tap.
   The TapGestureRecognizer with a NumberOfTapsRequired set to "2" should only fire on a double-tap. It currently fires even when slowly tapping on the label (which should be registered as single taps). 

**Build Date & Platform:**

   XF 1.3.4
   IOS

**Additional Information:**

   There is another section of code commented out where a different page is implemented using TapGestureRecognizer in code and setting the Command which does not reproduce the issue above.
Comment 1 Abhishek 2015-02-26 06:22:13 UTC
I have tried this issue and able to reproduce the reported behavior at my end.
 
Steps To Reproduce:
1. Run the attached sample and an iOS simulator/Device.
2. Double-click/tap the Label.
3. Observe that TapGestureRecognizer with a NumberOfTapsRequired set to "1" fires and then NumberOfTapsRequired set to "2" fires.

Expected result: Double-click/tap the Label, TapGestureRecognizer with a NumberOfTapsRequired set to "1" should not fire, only NumberOfTapsRequired set to "2" should fire.

Application output: https://gist.github.com/AkhileshKumar01/054a271fcb16881ec1ac
Screencast: http://www.screencast.com/t/x9hPCDnk0Zz6
IDE Log : https://gist.github.com/AkhileshKumar01/f81d250360be3ecaf413
iOS Device Log: https://gist.github.com/AkhileshKumar01/caac63fad975c998adb3

Build Info:

Xamarin.Forms 1.3.5.6333 pre1.
Xamarin.Forms 1.3.4.6332

=== Xamarin Studio ===

Version 5.7.2 (build 7)
Installation UUID: 93e693b0-b53d-40f4-b29c-b61ff5cbe892
Runtime:
	Mono 3.12.0 ((detached/b8f5055)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000077

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.2.22 (Trial Edition)
Hash: 862702c
Branch: 
Build date: 2015-02-18 15:19:23-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/xamarin23/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin.Mac ===

Version: 1.12.0.8 (Trial Edition)

=== Build Information ===

Release ID: 507020007
Git revision: dcf3f486177d3e625349b51a8f3be807e3fa7712
Build date: 2015-02-24 09:14:27-05
Xamarin addins: ea7c65bb7876e4a876ab365208e94acdf8f330ef

=== Operating System ===

Mac OS X 10.10.0
Darwin 800BC.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 Lala 2015-11-26 19:21:45 UTC
Fire once

  <BoxView HeightRequest="50" WidthRequest="50" BackgroundColor="Pink">
      <BoxView.GestureRecognizers>
        <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" NumberOfTapsRequired="1" />
      </BoxView.GestureRecognizers>
    </BoxView>

Does not fire at all

<BoxView HeightRequest="50" WidthRequest="50" BackgroundColor="Pink">
      <BoxView.GestureRecognizers>
        <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" NumberOfTapsRequired="2" />
      </BoxView.GestureRecognizers>
    </BoxView>

Does not fire at all

<Button HeightRequest="50" WidthRequest="50" Text="Tap">
      <Button.GestureRecognizers>
        <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" NumberOfTapsRequired="1" />
      </Button.GestureRecognizers>
    </Button>
Comment 3 E.Z. Hart [MSFT] 2016-04-08 19:08:44 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team