Bug 24026 - Clicks should have a dedicated event and not rely on a 1-tap TapGestureRecognizer
Summary: Clicks should have a dedicated event and not rely on a 1-tap TapGestureRecogn...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-10-23 17:03 UTC by luca.barbieri
Modified: 2015-05-20 15:12 UTC (History)
4 users (show)

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

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 luca.barbieri 2014-10-23 17:03:53 UTC
Currently Xamarin Forms does not have a click event handler, but rather relies on a 1-tap tap gesture recognizer for that. On platforms such as Android that have click handlers, you currently manually trigger 1-tap tap gesture recognizers in the onClick handlers using ad-hoc code.

However, this design is misguided.

The reason is that some platforms like Android support interacting with a keyboard, mouse and d-pad in addition to touch, which means that clicks are not only caused by touch, but also by those devices; also, accessibility tools probably use clicks as well.

Furthermore, a tap gesture recognizer should provide the (x, y) coordinates of the touch, which you obviously can't do if you try to translate clicks to tap gestures (since they might be the result of keyboard or d-pad interaction).

Instead, there should be a Clicked event or a similar mechanism and applications should use that rather than a tap recognizer, unless they need to explicitly recognize and act only on touch taps.
Comment 1 luca.barbieri 2014-10-23 17:06:04 UTC
And of course, on platforms that don't have a native click event, you should write code to trigger the click event from a tap gesture recognizer (rather than the opposite as you are doing now).
Comment 2 Jason Smith [MSFT] 2015-05-20 15:12:30 UTC
Thank you for your feature request. We will take your comments into consideration.