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 body scrolling issue when modal open #27698

Merged
merged 5 commits into from
Nov 23, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ class Modal {

this._adjustDialog()

$(document.body).addClass(ClassName.OPEN)
Copy link
Member

@Johann-S Johann-S Nov 21, 2018

Choose a reason for hiding this comment

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

does it works to move this line above this._adjustDialog() ? Because I'm not a big fan of adding that in _setScrollbar method because it's not the purpose of this method

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that but didn't work. We need to reduce the number of renderings.


this._setEscapeEvent()
this._setResizeEvent()

Expand Down Expand Up @@ -465,6 +463,7 @@ class Modal {
$(document.body)
.data('padding-right', actualPadding)
.css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)
.addClass(ClassName.OPEN)
}
}

Expand Down