NO BUG: Scroll Snap: Not-snappy sections get scrolled passed

Hi,

It seems Scroll Snap isnt working as I expect (my expectation could be wrong), but it still doesnt make sense.

In Page Settings > Scroll Snap I have set up my selector:

(I have tried this with and without the period (.) character)

[header]
[section class=“scroll-snap”]
[section class=“scroll-snap”]
[section = This section is more than 100vh in height]
[section = This section is more than 100vh in height]
[section class=“scroll-snap”]
[footer]

Issue

These sections without the .scroll-snap class, that are more than 100vh in height, get totally scrolled passed, rapidly, to the next .scroll-snap section (From Services to Testimonials). Surely this shouldn’t happen?

What I am expecting

Once the section with the .scoll-snap class finishes, the section should scroll as normal? So, in the example above, Projects and About should scroll freely with no “snapping”.

Please let me know if this is normal behaviour, as it seems strange to me.

Thanks

Hi Mike,
Thanks so much for your report!

It would be best if you use proximity instead of mandatory:

mandatory

The visual viewport of this scroll container must snap to a snap position if it isn’t currently scrolled.

proximity

The visual viewport of this scroll container may snap to a snap position if it isn’t currently scrolled. The user agent decides if it snaps or not based on scroll parameters. This is the default snap strictness if any snap axis is specified.

The main difference is must snap vs may snap, which will probably fix your problem.

Best regards,
timmse

Hi,

The same thing happens with both settings.

I think I actually want must snap on the sections with the class added.

This can’t be the case, as the values definitely work differently. Can you provide a live link? Without it, I can’t say anything more.

I guess I have to force myself out of the snapping section?

It still works a little oddly, it still seems very buggy, as you can see in some scrolling cases, it just flies right by my none-snap sections. See here: amazon.calummaui.com

That’s why I want to use a mandatory snap, and then just release it when the “snapping” section finishes.

I guess I’m just expecting it to “snap out” of the scroll snap section allowing users to freely scroll on the sections without the class.

Have a little scroll up and down the page and see if this is the true nature of the scroll snap feature.

Thanks,

It works as expected for me. The only thing the setting does is add scroll-snap-type and scroll-snap-align. The browser does the rest. The fact that this may not be quite as “smart” and “fluid” as with a Javascript solution cannot be avoided, as it is just simple CSS.

Thanks for confirming.