Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve click-detect algorithm for unscrollable areas #1378

Closed
pennersr opened this issue May 13, 2014 · 3 comments
Closed

Improve click-detect algorithm for unscrollable areas #1378

pennersr opened this issue May 13, 2014 · 3 comments
Assignees

Comments

@pennersr
Copy link

In issue #1362 we discussed altering the value of TAP_RELEASE_TOLERANCE. It resulted in allowing the value to be configurable, thanks for that. However, I am still triggered by the following remark:

"The reason it is so short is because when you have a large number you'll easily accidentally click a link even though you were scrolling a little bit, or if you flick the screen to scroll quickly you can also fire of a click accidentally. For every issue saying it's too short there's also an issue saying it's too large."

Native apps do not have this issue. You can try this with the iOS settings app.

  1. Open it, click on "General".
  2. Touch-and-hold the "< Settings" that appears in the upper left corner.
  3. While holding, you can move your finger almost 2cm away and release. This will still trigger a "click" on the back button. Note that it even visually indicates when you move too far away.

Apparently, next to the distance, the fact that the touch started in an unscrollable area of the screen apparently influences the behaviour of the click-detect algorithm.

So, addressing the original issue (frustrated users whose clicks do not register) by tweaking just the TAP_RELEASE_TOLERANCE is indeed not going to work. However, extending the algorithm with information on whether or not the starting area was scrollable or not will.

@adamdbradley
Copy link
Contributor

Checking if the target is within a scrollable area or not is a good idea. Also, I'll go further and try only using the 6px tolerance for scrollable .item elements, but not for clickable elements that are within scrollable content. For example, in iOS App Store, Top Charts tab, the list items themselves are no longer clickable after about 6px, but the button to purchase the app's have a much larger tolerance, like you pointed out about the back button. I think I'll start with a 50px tolerance for everything else which is not a scrollable .item. Does that seem fair?

@ajoslin
Copy link
Contributor

ajoslin commented May 14, 2014

fab4a41 reverted for now, via 1bfc859, for the beta.5b hotfix release.

Some unit tests weren't working.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants