RecipeFilter icon indicating copy to clipboard operation
RecipeFilter copied to clipboard

Added Touch support to the calls

Open sharinganthief opened this issue 6 years ago • 2 comments

sharinganthief avatar Apr 29 '19 19:04 sharinganthief

On most mobile browsers, these would fire twice; once for touchstart and once for click, for example. I guess you wouldn't notice because the event handlers are safe to re-run as written.

I think we can play it safe by adding e.stopPropagation() and e.preventDefault(), as discussed in this brief post: https://joshtronic.com/2015/04/19/handling-click-and-touch-events-on-the-same-element/

sean-public avatar Apr 30 '19 01:04 sean-public

Updated with event termination calls

sharinganthief avatar Apr 30 '19 15:04 sharinganthief

After testing on mobile, this doesn't seem necessary. The 300ms delay between the events firing feels fine since so much precedent there on the web.

sean-public avatar Jan 20 '24 08:01 sean-public