: [css-snappoints] elements and nested scrollers

In New York, we resolved to add back ‘elements’ as a value for scroll-snap-points-x/y[1].

However, I’m having second thoughts. Consider:

<div id="outer" style="overflow:scroll; scroll-snap-points-x: elements;>
    <div id=“intermediate" style="overflow:scroll">
        <div class=“inner" style="scroll-snap-coordinate:50% 50%"></div>
        ... more ...
    </div>
</div>

Now, scrolling #intermediate requires that .inner items be snapped to #outer, so as the middle scroller scrolls, the outer scrolling is snapping to different positions. This seems undesirable. In general it seems bad for snapping to ever cross scroller boundaries. In fact, this seems worse than the issue I was trying to address with ‘elements’, which was that something with with "scroll-snap-coordinate” could suddenly start snapping to a different scroller (maybe even the document), if different intermediate elements gain or lose scrollability.

There is one possible use case for skipping ancestor scrollers, which is if you want free horizontal scrolling in your immediate scroll container, but snapping on Y to happen on, say, the document.

Thoughts?

Simon

[1] <https://lists.w3.org/Archives/Public/www-style/2015May/0282.html>

Received on Monday, 15 June 2015 19:23:37 UTC