Skip to content

Commit 4648581

Browse files
authored
Memberships: Prevent subscribe popup from scrolling underlying content (#35553)
* Remove scrollTo on modal open
1 parent 87d6efa commit 4648581

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: bugfix
3+
4+
Disable scroll to top when memberships subscribe popup is opened.

projects/plugins/jetpack/extensions/shared/memberships.js

-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export function handleIframeResult( eventFromIframe ) {
2828
}
2929

3030
export function showModal( url ) {
31-
window.scrollTo( 0, 0 );
32-
3331
// prevent double scroll bars. We use the entire viewport for the modal so we need to hide overflow on the body element.
3432
document.body.classList.add( 'modal-open' );
3533

@@ -64,9 +62,6 @@ export function showModal( url ) {
6462

6563
window.addEventListener( 'message', handleIframeResult, false );
6664
dialog.showModal();
67-
68-
// This line has to come after the modal has opened otherwise Firefox doesn't scroll to the top.
69-
window.scrollTo( 0, 0 );
7065
}
7166

7267
function setUpModal( button ) {

0 commit comments

Comments
 (0)