MDN-Browser-Compatibility-Report-2020

scroll that's going to work fine.[...] Again I ran into a problem, if you want to control that, you want to have your own snapping behavior, and control the snapping via JavaScript. I think there's now the CSS snap points API, which is kind of covering that. I haven't heard that much about it, either because I just didn't know about the API, or it's really, really new and it's not widely supported. [...] I think the API would kind of cover that use case, and you can just have snap points defined in CSS and don't need JavaScript at all because it's all handled natively. Also it's important to differentiate between a single touch and a scroll. [...] If the user starts moving the carousel and then decides to also move their finger up and down, you don't want the browser to suddenly start a scroll interaction. You can do it on iOS, because on iOS you can call preventDefault() on the touchmove event, if the touchmove event hasn't led to a scroll yet. [...] On Chrome you can't do that and you have to stop the touchstart event [...] but then you don't know in which direction the user is scrolling. [...] Finding these things out is very difficult and very time intensive. I've done a lot of demos and codepens experimenting with browsers. It's very frustrating because there's not really standards for it, or documentation and stuff. [...] It was just very difficult to get these things working, like really, really, really difficult. We did a lot of iteration, a lot of testing, over time. I kind of got really obsessed with making scrolling really nice on mobile and trying to make native-like applications on the web that don't feel like they're just a glitchy web page.

Extra thanks to the anonymous participant who volunteered their time and expertise here, to help shed light on this complex set of problems.

Another interview participant explained how they need to use a JavaScript library to just get consistent scroll behavior across all browsers:

What gives me the most headaches is typically scrolling behavior of iOS. If I need to display a modal or something like a typical hamburger menu. It annoys me that I need a JavaScript library just to get this right, so that if I get a modal, that the background doesn't scroll on iOS. I think that's basically the worst issue that you stumble across in almost every project. [...] The goal is always that you lock scrolling completely. There's a good

Made with FlippingBook - professional solution for displaying marketing and sales documents online