Make WordPress Core

Changeset 60280


Ignore:
Timestamp:
06/05/2025 09:02:54 AM (6 weeks ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/assets/js/index.js

    r60040 r60280  
    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;
Note: See TracChangeset for help on using the changeset viewer.