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

Fix useScrollLock leaving inline styles and not considering initial padding before the lock #521

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

kyrylo-soulandwolf
Copy link
Contributor

Fixes #520

Copy link

changeset-bot bot commented Mar 3, 2024

🦋 Changeset detected

Latest commit: 65d1b7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
usehooks-ts Patch
www Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Fixed padding when the body is the target
- Fixed initial padding not being considered
@kyrylo-soulandwolf
Copy link
Contributor Author

I've also included a fix from #516 which fixes the order of locking the element and calculating the padding
@novacdenis tagging you so you're also aware 😉

@kyrylo-soulandwolf
Copy link
Contributor Author

Also, added isLocked state and appended it to the hook return which could be useful when locking and unlocking manually.

@juliencrn juliencrn self-assigned this Mar 4, 2024
@juliencrn juliencrn added the bug Something isn't working label Mar 4, 2024
@juliencrn juliencrn self-requested a review March 4, 2024 12:28
@juliencrn juliencrn removed their assignment Mar 4, 2024
Copy link
Owner

@juliencrn juliencrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍

@juliencrn
Copy link
Owner

@all-contributors please add @kyrylo-soulandwolf for code and bug

Copy link
Contributor

@juliencrn

I've put up a pull request to add @kyrylo-soulandwolf! 🎉

@juliencrn
Copy link
Owner

@all-contributors please add @novacdenis for code and bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] useScrollLock - Do not leave inline styles if they weren't present before the lock
2 participants