1
Vote

Add Tolerance to trigger to avoid missing click

description

Similar to patch: 12014 - BUT with some additional changes (see attached diff) and without allowing configuration of tolerance (I prefer allowing configuration)
 
I don't know if this fixes all of the issues with the above mentioned patch, but simply adding tolerance will cause some behavior problems.
 
This diff also tracks:
  1. currentTarget - the target over which the drag started. This avoids the drift problem introduced by adding tolerance due to the current code relying on '$(e.target).closest'.
     
  2. startX & startY - stores and calculates the distance the mouse has moved and only triggers drag start when the tolerance has been exceeded.
     
  3. dragStart - modified to use currentTarget rather than closest target to avoid the drift issue.
     
    I don't know if this diff fixes all remaining issues, but these were the ones I had encountered during my testing.

file attachments

comments