Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative scroll positions #35

Closed
peterkogo opened this issue Jul 12, 2018 · 9 comments
Closed

Negative scroll positions #35

peterkogo opened this issue Jul 12, 2018 · 9 comments

Comments

@peterkogo
Copy link

Problem:
On macOS you can scroll a little further than the actual size of the html document resulting in a rubber effect. This is only implemented in Chrome and Safari, but only produces negative pageYOffset values on Safari, resulting in glitching of the parallactic objects when pageYOffset goes below 0.

Possible Solution:
Without having looked through the code I assume the position tracking is done by pageYOffset lookups. Would it be possible to cap the scroll position at 0, which would save me a lot of workarounds? Or might this feature be useful in some cases?

@Stanko
Copy link
Owner

Stanko commented Jul 12, 2018

Hello @peterkey,
Ah, you are right, I already did it here https://github.com/Stanko/window-scroll-manager but forgot to bump version in Plx. I will release a fix in a few minutes.
Cheers!

@Stanko
Copy link
Owner

Stanko commented Jul 12, 2018

@peterkey actually, which version are you using? This was fixed 3 months ago, try updating version of Plx.

I will still update window-scroll-manager and release a patch.

EDIT: Please try using v1.3.2, and if you can still reproduce it, please make an example on https://codesandbox.io/ so I can track it down. Thanks!

@peterkogo
Copy link
Author

Yarn tells me I was on 1.3.1 . I've updated to 1.3.2 but my website just broke.

1.3.1 uses [email protected] and 1.3.2 [email protected]. Did you introduce some breaking changes?

@Stanko
Copy link
Owner

Stanko commented Jul 12, 2018

You are right again. Sorry :/ this is why I shouldn't make quick changes. I reverted window-scroll-manager version to 0.2.2.

Can you please create https://codesandbox.io/ example with [email protected] or ([email protected])?

@peterkogo
Copy link
Author

Here you go. I forked your example project and simply updated the dependency to 1.3.2. I get the same error message in my project.

@Stanko
Copy link
Owner

Stanko commented Jul 12, 2018

Yes, but I don't see the problem with plx and negative scroll. Am I missing something? Check the gifs I just recorded:

Chrome:
jul-12-2018 13-59-47

Safari:
jul-12-2018 14-02-40

@peterkogo
Copy link
Author

I narrowed it down. Here I updated the example. It has to do with values starting at the non initial value. I simply changed the rotation startValue from 0 to 15.

@Stanko
Copy link
Owner

Stanko commented Jul 12, 2018

Nice! Yes, I see it in Safari now. It is a weird one, I'll check what is going on.

EDIT: Found it! Fix coming up.

@Stanko
Copy link
Owner

Stanko commented Jul 12, 2018

Here it is finally!

Try fixed example in Safari:
https://5kmr527q2n.codesandbox.io/

and here is code (just update version to 1.3.5) https://codesandbox.io/s/5kmr527q2n)

Sorry for the messy turnaround.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants