Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is -webkit-overflow-scrolling suitable for production use?

I have been using -webkit-overflow-scrolling for smooth scrolling on iOS for an overlay nav menu, however, I have been fighting with a bug (that I can't seem to find the answer to anywhere).

Looking at the MDN site for the property it says:

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user....

https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-overflow-scrolling

Why is there such widespread use of it if it is "not on a standards track"? How can we allow for smooth scrolling on iOS via a standards-compliant method? Are there any alternatives to the property that are suitable for production?

like image 870
Geraint Avatar asked Nov 10 '16 16:11

Geraint


1 Answers

Why is there such widespread use of it if it is "not on a standards track"?

Usually, authors wind up using non-standard features not knowing, or caring, that they're non-standard. This is why so much of the web depends on WebKit-specific properties to even work, to the point where the WHATWG had to draft up a spec designating certain WebKit-specific properties to be supported by competing browsers for compatibility purposes, and why sources like MDN caution authors against using non-standard features in production.

But in the case of -webkit-overflow-scrolling, it's an iOS-specific feature that Apple has designed with the specific intention of production use — to enable native-style scrolling on web apps on Safari on iOS. Despite MDN's template warning, it is entirely appropriate to use it in production sites as long as you understand that it's an iOS-specific feature (one of the few that actually use vendor prefixes as intended) and its behavior may change as iOS receives software updates.

And on that note, if you've encountered a bug with -webkit-overflow-scrolling, you'll just have to report it to Apple and hope they fix it eventually.

How can we allow for smooth scrolling on iOS via a standards-compliant method?

Scrolling mechanisms are platform-specific by nature, so there is no standard for controlling how the scrolling mechanism works (overflow doesn't count).

Are there any alternatives to the property that are suitable for production?

No; as mentioned, this property was designed for that specific purpose and is suitable for use in production.

like image 70
BoltClock Avatar answered Nov 04 '22 05:11

BoltClock