Re: Pointer Events and click

From: Scott González <<>>
Date: Mon, 3 Dec 2012 08:10:44 -0500
To: Jacob Rossi <<>>
Cc: Daniel Freedman <<>>, "<>" <<>>
Subject: Re: Pointer Events and click
Resent-From: <<>>
Resent-Date: Mon, 3 Dec 2012 13:11:19 +0000

On Sun, Dec 2, 2012 at 6:27 PM, Jacob Rossi <<>> wrote:
" There are cases in which a developer would want to conditionally react to a click based on pointer movement" sounds to me like the uses cases delve into gesture recognition, which is out of scope for our charter.

I don't have a major concern either way, but I just wanted to note a case in jQuery UI where we care about conditionally forcing a click based on pointer movement, but we don't actually care about gestures. We have a button widget which can build on top of various markup. When applied to a checkbox or radio, we visually hide the form control and style the label. Browsers generally have some tolerance for movement during a click. At least in Firefox, there is a noticeable difference in the tolerance allowed when clicking on a checkbox vs. clicking on a label associated with a checkbox. This is likely to make text selection of the label prevent toggling the checkbox. However, since we're treating the label as a button, we're not concerned with text selection and would like the larger movement tolerance that comes with the form control itself. The only way to work around this is to listen to mousedown/up and then check if a click or change event occurred on the checkbook and if not manufacture one.

I believe this is the only place in jQuery UI where we conditionally care about clicks based on movement, so I don't have strong feelings either way. I do agree with everything else Jacob has said. In general, I don't think we should use "developers are familiar with X from Touch Events" as a strong argument for anything in Pointer Events as the majority of developers are not familiar with Touch Events and many that are familiar with them have complaints about them.

Just an addition: Been a long time since I worked on the jQuery UI code-base, but pretty sure all the drag & drop stuff are also places we care about clicks based on movement, but in a more manual way.  We have a distance threshold there to not accidentally initiate drags when the user intention is really a click.

Received on Monday, 7 January 2013 16:17:52 UTC