Bug 46363 - TapGestureRecognizer blocks List View Context Actions
Summary: TapGestureRecognizer blocks List View Context Actions
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: 2.4.0
Assignee: E.Z. Hart [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-11-03 08:28 UTC by Dmitijs Jesilevskis
Modified: 2018-04-23 15:20 UTC (History)
13 users (show)

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


Attachments
Sample project (76.42 KB, application/x-zip-compressed)
2016-11-03 08:28 UTC, Dmitijs Jesilevskis
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 Dmitijs Jesilevskis 2016-11-03 08:28:32 UTC
Created attachment 18314 [details]
Sample project

When tap gesture recognizer is added to the List View item with Context Menu, Context Menu no longer could be opened as TapGestureRecognizer blocks/intercepts all calls.

Sample project attached.
Steps:
1. Run app;
2. Navigate to List View Test;
3. Try long-tapping any list item to open Context Menu;
4. Tap event is triggered instead of Context Menu opening.

          <DataTemplate>
            <ViewCell>

              <ViewCell.ContextActions>
                <MenuItem Text="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding .}" />
              </ViewCell.ContextActions>

              <StackLayout Orientation="Vertical" Spacing="0" Padding="8"
                            HorizontalOptions="FillAndExpand" BackgroundColor="White">
                <StackLayout Orientation="Vertical" Spacing="0" Padding="4, 4, 4, 10"
                              HorizontalOptions="FillAndExpand" BackgroundColor="White">
                  <StackLayout.GestureRecognizers>
                    <TapGestureRecognizer Command="{Binding ShowCommand}" CommandParameter="{Binding .}" />
                  </StackLayout.GestureRecognizers>

                  <Label Text="{Binding Name}" HorizontalOptions="FillAndExpand" />
                  <Label Text="{Binding Description}" HorizontalOptions="FillAndExpand" />
                </StackLayout>
              
              </StackLayout>
            </ViewCell>
          </DataTemplate>
Comment 1 Dmitijs Jesilevskis 2016-11-03 08:29:30 UTC
Issue might share root cause with:
https://bugzilla.xamarin.com/show_bug.cgi?id=45351
Comment 2 FernandoVM 2017-04-15 02:42:49 UTC
Dear, are there some workaround suggested?
Comment 3 E.Z. Hart [MSFT] 2017-06-10 00:21:52 UTC
PR: https://github.com/xamarin/Xamarin.Forms/pull/985
Comment 4 Rui Marinho 2017-06-22 09:47:50 UTC
Should be fixed on 2.3.6-pre1
Comment 5 FernandoVM 2017-06-22 09:50:01 UTC
Thanks, great news!
Comment 6 FernandoVM 2017-07-14 18:04:01 UTC
Some prevision about the release date of versions 2.3.6-pre1 or/and 2.3.6-stable?
Comment 7 Mathieu Benoit 2017-09-14 14:57:29 UTC
Hi there, does anyone could confirm this issue has been fixed and included in both current latest versions: 2.3.4.270 and 2.4.0.269-pre2 please? Thanks!
Comment 8 Guy 2017-09-14 16:31:54 UTC
I have tried 2.4.0.269 and also 2.3.4.270 and this issue is not fixed, if I slide the cell and long click a button, leave the page and come back, the cell no longer slides, cannot see the button.
At this point the only way to continue is to restart the app. Is there any date that we can see this fix, I would need to either find a work around or be able to give a date that this issue would be fixed.
Thank you,
Guy
Comment 9 Mathieu Benoit 2017-09-14 16:43:57 UTC
Thanks Guy for your prompt feedback on that! 
Just in case, does anyone has tried or could try if the issue is still happening with the latest nightly build?
https://github.com/xamarin/Xamarin.Forms/wiki/Nightly-Builds
Thanks!
Comment 10 Dmitijs Jesilevskis 2017-09-15 06:59:06 UTC
I've updated original example project to 2.4.0.269-pre2, and the original issue does not seem to fixed.
Comment 11 Samantha Houts [MSFT] 2017-09-21 00:15:33 UTC
Please try 2.4.0-pre3. I believe this was resolved by https://github.com/xamarin/Xamarin.Forms/pull/1135. Thank you!
Comment 12 Guy 2017-09-21 18:42:06 UTC
Hello Samantha,
I just finished testing 2.4.0.275-pre3 and the issue is fixed, I tried it in parallel to the app currently in production and was not able to recreate the issue, do you have any idea as to when it will be released as stable?
Thank you,
Guy
Comment 13 Samantha Houts [MSFT] 2017-09-21 20:25:28 UTC
Fantastic! I do not have a solid date for 2.4.0 stable, but it is our highest priority. Thank you!
Comment 14 Dmitijs Jesilevskis 2017-09-22 06:15:58 UTC
Hello,

Upgraded attached sample project to 2.4.0.275-pre3 to verify the fix (all cleaned up). In my opinion issue is not fully fixed. Please review behavior changes outlined below.

Behavior before 2.4.0.275-pre3:
When long-tapping any list item, command bound to single-tap TapGestureRecognizer got executed. In sample app - Popup is appearing.

Behavior with 2.4.0.275-pre3:
When long-tapping any list item, absolutely nothing happens. 
- Command bound to TapGestureRecognizer is not executed.
- List item Context Actions are not opening

Expected behavior:
- On single-tap on list item - TapGestureRecognizer command is executed (popup appears)
- On long-tap - list item Context Menu opens.
Comment 15 E.Z. Hart [MSFT] 2017-09-22 17:35:59 UTC
PR: https://github.com/xamarin/Xamarin.Forms/pull/1154
Comment 16 Rui Marinho 2017-09-27 19:24:54 UTC
Should be fixed on 2.4.1-pre1
Comment 17 FernandoVM 2017-10-12 22:26:23 UTC
Some prevision about the release date of versions 2.4.1-pre1 or/and 2.4.1 stable? I would like test it, this bug is very old and inconvenient.

I had tested with version 2.4.0.282 and both long-tapping (using context actions) and single-tap (using tap gesture) until work, but of irregular way. The underlaying command binded is not executed 100% of times, sometimes is executed 70% of times, sometimes 50%. If I remove the context action commands, the tap gesture binded command is executed near 100% of times.
Comment 18 Noe 2018-04-19 01:52:35 UTC
Hi maybe this issue is related to the same.

when I have a Gesturerecognizer and contextactions and I clicked the cell (no long click) to navigate to another page the black navigation bar  appears (in android) to performs an action but it shouldn't do that.
Comment 19 Noe 2018-04-19 01:53:27 UTC
Hi maybe this issue is related to the same.

when I have a Gesturerecognizer and contextactions and I clicked the cell (no long click) to navigate to another page the black navigation bar  appears (in android) to performs an action but it shouldn't do that.
Comment 20 E.Z. Hart [MSFT] 2018-04-23 15:20:27 UTC
(In reply to Noe from comment #19)
> Hi maybe this issue is related to the same.
> 
> when I have a Gesturerecognizer and contextactions and I clicked the cell
> (no long click) to navigate to another page the black navigation bar 
> appears (in android) to performs an action but it shouldn't do that.

Noe - if you're still experiencing a problem you should open a new issue at https://github.com/xamarin/Xamarin.Forms/issues 

The Bugzilla tracker is no longer actively used.