multiple issues when context isn't window
Closed this issue · 3 comments
jedwards1211 commented
- scroll jumps to 0 then animates to end position (this is because
window.pageYOffset
is used even whencontext !== window
- scroll end position is often incorrect, e.g. when
context.scrollTop !== 0
- smooth scrolling to the end doesn't ease out in some cases. Solution: clamp the end position to
context.scrollHeight - context.offsetHeight
These issues are fixed in my PR #20
powerbuoy commented
I'd also like to see this fixed. As well as support for horizontal scrolling.
dennismphil commented
Tried 0.2.2
with webpack and noticed an error. My guess is, this issue is also related to not setting the context correctly in the library
Error:
/js/smoothscroll.js:27
ent.querySelectorAll === void 0 || window.pageYOffset === void 0 || history.pu
^
ReferenceError: history is not defined
aabbi commented
facing the same issue as @dennismphil