Bug 55912 - Tap event not always propagated to containing Grid/StackLayout
Summary: Tap event not always propagated to containing Grid/StackLayout
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
: 54492 ()
Depends on:
Reported: 2017-05-03 11:40 UTC by Gert Jan Schoneveld
Modified: 2017-06-29 11:54 UTC (History)
6 users (show)

Tags: android tapgesturerecognizer grid stacklayout
Is this bug a regression?: Yes
Last known good build:

repro project (295.02 KB, application/x-zip-compressed)
2017-05-03 16:00 UTC, Jimmy [MSFT]

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:

Description Gert Jan Schoneveld 2017-05-03 11:40:18 UTC
In our app we have some Grids and StackLayouts with labels and icons that as a whole act like a button. We made this with a single TapGestureRecognizer on those Grids/StackLayouts.

The problem now is that with the latest Forms ( on Android the TapGestureRecognizer is not called most of the time. About 3 out of 4 taps fail. It seems that the labels in those Grids/StackLayouts eat the tap events.

Android only. It doesn't happen on iOS.

(As a workaround I will put TapGestureRecognizers on all individual components; that seems to work)
Comment 1 Jimmy [MSFT] 2017-05-03 16:00:39 UTC
Created attachment 21922 [details]
repro project

I created a sample project and I'm seeing the issue described. In the sample project, I have a Grid and StackLayout each with a TapGestureRecognizer added.

This appears to be a regression introduced in 2.3.5, possibly related to https://github.com/xamarin/Xamarin.Forms/pull/842

### Steps to reproduce
1. Run the attached Android project
2. Tap on the red Grid
3. Tap on the Label in the blue StackLayout

### Expected Results
The debug output will indicate the TapGesture was activated.

#### Actual Results
The TapGesture is activated. In the red Grid, the Label is swallowing the tap regardless of where on the Grid you tap.

In the blue StackLayout, the event is not bubbled up to the StackLayout if the tap occurs on the Label. So tapping the area outside the Label will still work.

### Workaround
You can set the InputTransparent on the Label to 'true'.

### Regression Test    BAD
2.3.5-pre2  BAD   GOOD
Comment 2 E.Z. Hart [MSFT] 2017-05-04 01:43:01 UTC
Comment 3 Rui Marinho 2017-05-04 10:02:53 UTC
Should be fixed on 2.3.5-pre3
Comment 4 E.Z. Hart [MSFT] 2017-05-10 17:32:16 UTC
*** Bug 54492 has been marked as a duplicate of this bug. ***
Comment 5 Gaurav Ganorkar 2017-06-29 11:54:23 UTC
Verified this issue on the latest xamarin forms version
Issue is fixed now.Verified on

=== Visual Studio Community 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 1258)
Installation UUID: 473a8fdd-3836-4e5e-a5c3-b537689e827f
 Mono (2017-04/478c04a) (64-bit)

=== Xamarin.iOS ===

Version: (Visual Studio Community)

=== Xamarin.Android ===

Version: (Visual Studio Community)

=== Xamarin.Mac ===

Version: (Visual Studio Community)

Xamarin forms version