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

adding option to fill scrollbar gap #14

Merged
merged 2 commits into from
May 5, 2018
Merged

adding option to fill scrollbar gap #14

merged 2 commits into from
May 5, 2018

Conversation

martinkutter
Copy link
Contributor

No description provided.

@@ -62,7 +77,7 @@ const handleScroll = (event: HandleScrollEvent, targetElement: any): boolean =>
return true;
};

export const disableBodyScroll = (targetElement: any): void => {
export const disableBodyScroll = (targetElement: any, options?: BodyScrollOptions): void => {
Copy link
Owner

Choose a reason for hiding this comment

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

would you need to apply the same options to enableBodyScroll on line 124?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that's not really necessary. Padding is automatically reset when setOverflowAuto() is called. I can't imagine a use case where you want to fill the gap but don't want to reset it.

Copy link
Owner

Choose a reason for hiding this comment

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

good point

@@ -22,10 +27,16 @@ const preventDefault = (rawEvent: HandleScrollEvent): boolean => {
return false;
};

const setOverflowHidden = () => {
const setOverflowHidden = (options?: BodyScrollOptions) => {
const reserveScrollBarGab = !!options && options.reserveScrollBarGap === true;
Copy link
Owner

Choose a reason for hiding this comment

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

just a typo here reserveScrollBarGap instead of reserveScrollBarGab

@willmcpo
Copy link
Owner

willmcpo commented May 3, 2018

Could you also update the README @martinkutter re the options parameter? then we're good to go, thanks for the PR

@martinkutter
Copy link
Contributor Author

@willmcpo I fixed the typo and added a suggestion for the documentation.

@willmcpo willmcpo merged commit 31e7383 into willmcpo:master May 5, 2018
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

Successfully merging this pull request may close these issues.

2 participants