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 (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
: 54492 (view as bug list)
Depends on:
Reported: 2017-05-03 11:40 UTC by Gert Jan Schoneveld
Modified: 2017-06-29 11:54 UTC (History)
6 users (show)

See Also:
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]

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

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

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.

Note You need to log in before you can comment on or make changes to this bug.