Skip to content

Commit 91a74b3

Browse files
committed
Themes: A11y: Fix scroll jump when closing modal navigation.
Fix an issue where navigation and search modals triggered an undesirable scroll behavior if triggered while the page was not scrolled all the way to the top. Props kjellr, nikunj8866, sabernhardt, karmatosed, sainathpoojary, joedolson. Fixes #52116. git-svn-id: https://develop.svn.wordpress.org/trunk@60280 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ad13a2d commit 91a74b3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/wp-content/themes/twentytwenty/assets/js

src/wp-content/themes/twentytwenty/assets/js/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ twentytwenty.coverModals = {
257257
clickedEl = false;
258258
}
259259

260-
_win.scrollTo( 0, Math.abs( _win.twentytwenty.scrolled + getAdminBarHeight() ) );
260+
_win.scrollTo({
261+
top: Math.abs( _win.twentytwenty.scrolled + getAdminBarHeight() ),
262+
behavior: 'instant'
263+
});
261264

262265
_win.twentytwenty.scrolled = 0;
263266
}, 500 );

0 commit comments

Comments
 (0)