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

WebPreview: prevent scrolling when web preview is open. #3984

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

mtias
Copy link
Member

@mtias mtias commented Mar 11, 2016

Also removes extra scrollbars from body. See #3901.

Fixes #316

@mtias mtias added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Components [Feature Group] Appearance & Themes Features related to the appearance of sites. [Feature] Post/Page Editor The editor for editing posts and pages. labels Mar 11, 2016
@@ -70,6 +71,10 @@ const WebPreview = React.createClass( {
if ( this.props.previewUrl !== 'about:blank' ) {
this.setIframeUrl( this.props.previewUrl );
}

if ( this.props.showPreview ) {
componentClasses( document.documentElement ).add( 'no-scroll' );
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just start using classList instead?

document.documentElement.classList.add( 'no-scroll' );

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call.

@aduth
Copy link
Contributor

aduth commented Mar 11, 2016

Works as expected.

Would like to see my recommended change made, but otherwise looks good 👍

@aduth aduth added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 11, 2016
Also removes extra scrollbars from body.
@mtias mtias force-pushed the fix/web-preview-double-scrolls branch from f7fe29a to 4380556 Compare March 11, 2016 17:28
@mtias mtias added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Mar 11, 2016
@aduth
Copy link
Contributor

aduth commented Mar 11, 2016

👍

@aduth aduth added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 11, 2016
mtias added a commit that referenced this pull request Mar 11, 2016
WebPreview: prevent scrolling when web preview is open.
@mtias mtias merged commit 3b5be1f into master Mar 11, 2016
@mtias mtias deleted the fix/web-preview-double-scrolls branch March 11, 2016 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Components [Feature Group] Appearance & Themes Features related to the appearance of sites. [Feature] Post/Page Editor The editor for editing posts and pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants