![]() No as mentioned, this property was designed for that specific purpose and is suitable for use in production. Scrolling mechanisms are platform-specific by nature, so there is no standard for controlling how the scrolling mechanism works ( overflow doesn't count).Īre there any alternatives to the property that are suitable for production? How can we allow for smooth scrolling on iOS via a standards-compliant method? The initial CSS makes the numbered box snap into the center of the viewport. With scroll snap, one of the numbered boxes that you scroll to will snap into place. 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.Īnd 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. The CSS scroll snap module provides properties that let you control the panning and scrolling behavior by defining snap positions. To view scroll snapping in the box below, scroll up-and-down and left-and-right through the grid of 45 numbered boxes in the scrollable viewport. 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.īut 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. ![]() Usually, authors wind up using non-standard features not knowing, or caring, that they're non-standard. The -webkit-overflow-scrolling CSS property controls whether or not touch devices use momentum-based scrolling for a given element. ![]() There may also be large incompatibilities between implementations and the behavior may change in the future. Why is there such widespread use of it if it is "not on a standards track"? Do not use it on production sites facing the Web: it will not work for every user. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |