Hacker News new | ask | show | jobs
by tmanderson 5018 days ago
What's the deal with these posts? First the one from Facebook and now this one?

If it's too hard for you to differentiate between a scroll and a touch, there's about 210923423234 libraries out there that can make that differentiation for you.

1 comments

There's a significant amount of effort put into touch handling on the native side of the world. Browser-based apps shouldn't be in the business of emulating the native behavior unless absolutely necessary. (Unfortunately, it's painfully frequent atm)

You encounter difficulties such as:

* Different behavior across platforms (and risking uncanny valley responses if you don't duplicate it; particularly around scrolling)

* When the browser provides hooks into the underlying native code, the current event structure can't satisfy. For example, `-webkit-overflow-scrolling: touch` fires scroll events erratically on iOS and fails to update the scroll position between them.

* Fun "bugs" such as iOS Safari's annoying behavior of popping down the nav bar when you tap any anchor that has a href attribute - regardless of whether you intercept and cancel the events in either phase.

It's a matter of finding a balance between abstracting platforms and simply exposing their underlying mechanics. I'm not sure which side should win there.