scrollsnap-polyfill icon indicating copy to clipboard operation
scrollsnap-polyfill copied to clipboard

Pick the nearest element in the direction of scrolling

Open frankier opened this issue 9 years ago • 2 comments

I think this behaviour is best generally. When compared to Firefox's implementation, Firefox will always scroll to the next in the direction if you press a button on the scrollbar, but if you drag it will snap to the current nearest. In our case, we can't tell which happened, so I think going to the nearest in the direction of scrolling is a reasonable option.

frankier avatar Jan 31 '16 15:01 frankier

While I agree with the behaviour, there is a bug that prevents one from scrolling back to the previous element, when using snap-coords.

Reproduce: See demo/coordinates.html Scroll to element 2 Scroll back to element 1 It snaps back to element 2

Expected: snap to element 1.

@frankier: do you want to fix it yourself?

ckrack avatar Feb 04 '16 13:02 ckrack

Hi, I'm probably not going to fix this since my fix works fine for my own purpose. Please just treat this PR as a bug report in that case. Thanks.

frankier avatar Feb 13 '16 20:02 frankier