body-scroll-toggle icon indicating copy to clipboard operation
body-scroll-toggle copied to clipboard

Temporarily disable `scroll-behavior: smooth` from `<html>` and/or `<body>` when restoring scroll position

Open proimage opened this issue 6 years ago • 2 comments

When the script returns the user to the stored scroll position upon bodyScroll.enable(), the "inner workings" are very obvious when the site has native smooth scrolling enabled. To work around this, I think it should be possible to detect scroll-behavior: smooth on html or body, temporarily disable smooth scrolling until the scroll position has been restored, and then re-enable smooth scrolling.

proimage avatar Nov 04 '19 17:11 proimage

FWIW, I've been using https://github.com/willmcpo/body-scroll-lock lately rather than this package. But I'd be happy to take a PR to this if you want to submit one.

weotch avatar Nov 04 '19 19:11 weotch

Ooh, ok, I'll check that one out. Thanks!

proimage avatar Nov 06 '19 12:11 proimage