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

Stickybits isn't adding padding to parent element when position is changed to fixed #185

Open
Ibrahimrahhal opened this issue Jan 19, 2021 · 1 comment

Comments

@Ibrahimrahhal
Copy link

Describe the bug
when sticky bits is initiating it gets all the elements with the selector passed and calculated and sticky start and end portion for each one.
so when having multiple sticky elements in the page and the first element is converted to a fixed position the document flow will change(the element is now out of document flow and the parent will shrink) this will affect the proceeding element sticky start position

To Reproduce
Having any element use the sticky plugin and then scroll to make the element position fixed notice the parent element will shrink
Expected behavior
to emulate sticky positioning the element shouldn't be removed from the document flow I suggest adding padding to the parent element or adding an empty div with the same height
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
the main problem is that the sticky start position for the element will be broken and the user will have to scroll more distance for it to work

@yowainwright
Copy link
Owner

I want to get to this issue pretty fast!
@Ibrahimrahhal would you by chance have the time to make your own PR with updates to this one?

Thanks!!! 🙏

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