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

setPin() doesn't properly push followers when pinned on top #983

Open
JingkangZhang opened this issue Mar 19, 2021 · 0 comments
Open

setPin() doesn't properly push followers when pinned on top #983

JingkangZhang opened this issue Mar 19, 2021 · 0 comments

Comments

@JingkangZhang
Copy link

When triggerHook is 0 and element trigger is on top of the page, i.e., triggers overlap on top of the page, there's a chance (when the page is refreshed in Firefox or refreshed with dev panel open in Chrome) the style: position: fixed gets applied to the pinned element before followerPusher gets a chance to set its own height (aka pushing the followers) to the height of the pinned element. The solution is to set element trigger at least 1 px below the top of the viewport, where the triggerHook is at.

Screen Shot 2021-03-19 at 4 45 26 AM

Notice in picture 1 div with id #triggerTurnRed has style top: 0, causing the pinned element with id #opening-pin to have style position: fixed instead of position: relative and the pin spacer to not have a height.

Screen Shot 2021-03-19 at 4 45 57 AM

In picture 2, notice the same fields. Everything is as desired.

JingkangZhang added a commit to JingkangZhang/PersonalWebsite that referenced this issue Mar 19, 2021
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

1 participant