mawil583 / Spades-Calculator

spades-calculator.vercel.app
2 stars 1 forks source link

Improve mobile button UX for hover/click #35

Open mawil583 opened 1 year ago

mawil583 commented 1 year ago

Background

On mobile, hover gets activated before click does. onMouseDown (when the user clicks mouse without letting go) triggers hover. It's only onMouseUp (the user letting go of the click) that actually triggers a click. On mobile, if enough time passes between onMouseDown and onMouseUp, then the click event does not register. Is this behavior unique to a browser, or is it something that we can control with code? In other words, can we implement some code that would trigger a click event even after the user held down a button for 5 seconds? If so, find out what default time lapse is, and increase it slightly so that we can avoid the scenario when a user accidentally holds the button for too long and it doesn't register a click.

onMouseDown/onMouseUp might actually be ontouchstart/ontouchend for touchscreen devices.

Acceptance Criteria

Find out if it's possible to adjust click/hover timing on mobile. If it is, increase time lapse by 33%. If it isn't, link that documentation/resource to this task.