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

Better explanation of how it should work #31

Closed
ezhlobo opened this issue May 12, 2022 · 3 comments
Closed

Better explanation of how it should work #31

ezhlobo opened this issue May 12, 2022 · 3 comments
Assignees
Labels

Comments

@ezhlobo
Copy link

ezhlobo commented May 12, 2022

I got the issue with this package and I tried to figure out how it's supposed to be used properly.

To debug my issue and figure out options I created this snippet that sets different values of padding and margin to <body> and with different gapMode: https://codesandbox.io/s/remove-scroll-bar-i7obpk

It seems for me like it works not very stable with gapMode=margin. With padding mode it seems more robust, but doesn't take into account previous value.

I'd be happy to help and make it handling all those cases, but I expect there are more of them. So if you can help me with more use cases I'd be able to help you coding the fix. Alternatively I'd expect some documentation of what this package expect to be set over <body> to keep it working.

@ezhlobo
Copy link
Author

ezhlobo commented May 12, 2022

Another point is that this package sets double shift in margin mode. And it happens with a delay: first it sets 0 padding-right and 15px margin-right, then inside useEffect it adds 15px to padding-right in addition to 15px margin-right.
2022-05-12 13-58-04

@theKashey
Copy link
Owner

I am still trying to remember why margin was picked over padding, and believe me - I’ve spend a few months playing around it (now I remember it)

but so far the best (but not good) source of information for me is my younger me - https://medium.com/react-camp/how-to-fight-the-body-scroll-2b00267b37ac

@stale
Copy link

stale bot commented Apr 30, 2023

This issue has been marked as "stale" because there has been no activity for 2 months. If you have any new information or would like to continue the discussion, please feel free to do so. If this issue got buried among other tasks, maybe this message will reignite the conversation. Otherwise, this issue will be closed in 7 days. Thank you for your contributions so far.

@stale stale bot added the state label Apr 30, 2023
@stale stale bot closed this as completed May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants