Closed hirasso closed 2 years ago
@daun any opinion on this?
Just corrected the docs for now, see PR above.
I agree about extending the method to allow targeting other elements but we'd need to wait for upstream changes to the underlying scroll library, no?
Already created a PR for that: https://github.com/gmrchk/scrl/pull/1
While cleaning up I noticed that the docs about
swup.scrollTo()
are outdated:https://swup.js.org/api/methods#scrollto
Which lead me to think closer about it. The current implementation in Scroll Plugin allows setting the
animated
argument, which doesn't really make sense here, since animating the scroll position would be the whole point of using the method in the first place.We should probably rather discuss if we want to allow targeting a specific element to be scrolled, something like this (Pseudo Code):
Making this possible would need enhancements of gmrchk/scrl, to add the possibility to target and handle specific elements other than
window
.This is somewhat related to #26 .