body-scroll-toggle
body-scroll-toggle copied to clipboard
Temporarily disable `scroll-behavior: smooth` from `<html>` and/or `<body>` when restoring scroll position
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.
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.
Ooh, ok, I'll check that one out. Thanks!