Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I have a simple Label with a TapGestureRecongizer. Tapped event only fires intermittently, and approx 25% of the time on iOS only. This was a problem on both iOS and Android in Forms version 1.4.4, and was fixed for Android with 1.5.0. I am still seeing the problem occur on iOS only in Forms 1.5.0.
Do you happen to have a small reproduction project that I can use to verify that we are fixing the exact issue you are reporting? If not, can you tell me what value you are using for NumberOfTapsRequired, and whether or not you have more than one TapGesture on the Label? Do you see this issue occur mainly when you are tapping quickly in rapid succession? Finally, are you altering the same Label on Tapped, or does the Tapped event do something else?
Hello, I don't have a reproduction project, but can create one. In the
meantime I can just answer the questions.
- NumberOfTapsRequired = I have tried both not setting it at all, and
explicitly setting it to 1 - with no noticeable effect.
- Only 1 TapGestureRecognizer is on the Label
- It occurs even if not tapping in rapid succession, e.g., 1 second or more
- I am not altering the same Label, the Tapped event handler will make
something else visible/invisible on the same page (but of course the Tapped
event is not firing all the time so this code is not being called).
Okay, if you could send us a reproduction project, I think it would really help narrow down the problem. Thank you!!
Created attachment 13977 [details]
Sample App for TapGestureRecognizer problem
Here is the requested sample app. Thanks
Hint - this problem seems only to occur when the Label and it's associated TapGestureRecognizer are on a ContentView. It did not occur when I tried it on a ContentPage.
Awesome, thank you! I definitely can reproduce the issue with your test project. I noted that it is using Xamarin.Forms 1.3.3. When I updated to 1.5.0 or later, I no longer saw the issue. Can you confirm if you still see the issue after updating the package on your end? Thanks!!!
Created attachment 13991 [details]
Sample Application - Updated to reference Forms version 1.5
Hello - I updated the version of Forms to 1.5 as requested (new project attached)- the problem still occurs for me on an iPad running iOS 9.1.
I tested your latest attached project on an iPad running iOS 9.1, and I am still having trouble reproducing the issue. I do notice that tapping directly on the words "Tap here..." do not fire the event, since the iOS status bar is absorbing the event. However, if I click anywhere else within the green label, it consistently fires the event. Also, if I add padding to the grid to shift it away from the status bar, I can click directly on the text and get the event to fire consistently.
It is only when I have accidentally moved my finger just past the bounds of the label that the event fails to fire. The bounds are pretty strict, and if the tip of my finger taps outside of the bounds of the label before it taps the label, the event doesn't fire. This makes it look as if tapping the label does nothing, but if I am careful to actually touch the label first, it does fire the event.
Does it seem to make a difference if you tap the label in a different location?
Hi Samantha, thanks for the info. I observed that moving the control with the TapGestureRecognizer away from the iOS status bar DOES help in my reproduction project. Unfortunately making a similar change in my application is not having any effect. In the case of my app though, it is being referenced as a custom control which is nested in a bunch of other infrastructure. I am trying to narrow down the difference between the repro project and my actual app and will get back to you asap!
Hi Samantha - I found the problem. The taps are not recognized consistently when the property VerticalOptions = "Center" or "CenterAndExpand" is on the Label with the gesture recognizer. Other settings for VerticalOptions are fine, but I do want to center the label text. You can add this one property to my reproduction project and see the problem. Let me know what you think. Thanks
Hmm. I added the VerticalOptions property to the Label with the value Center and then the value CenterAndExpand, and it did not seem to change the behavior on my end.
<Label Text="Tap Here to Expand/Collapse" BackgroundColor="Green" Grid.Row="0" VerticalOptions="CenterAndExpand">
<TapGestureRecognizer x:Name="tapRec" Tapped="OnExpandCollapse"></TapGestureRecognizer>
Did I put it in the correct place?
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.
Xamarin Forms Team