Make WordPress Core

Changeset 56243


Ignore:
Timestamp:
07/16/2023 04:43:07 PM (17 months ago)
Author:
joedolson
Message:

Help/About: Fix closing contextual help when scrolled.

Change from scrollIntoView to scrollIntoViewIfNeeded so scrolling will only fire when it is required. scrollIntoViewIfNeeded is a proprietary method that is not standardized and not currently on a track towards standards. However, testing has it working well, including in Firefox, which supposedly does not support it.

Props mikecho, studionashvegas, mai21, piotrek, Heiko_Mamerow, costdev, joedolson.
Fixes #55342.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/common.js

    r55327 r56243  
    14081408     */
    14091409    $('#contextual-help-link, #show-settings-link').on( 'focus.scroll-into-view', function(e){
    1410         if ( e.target.scrollIntoView )
    1411             e.target.scrollIntoView(false);
     1410        if ( e.target.scrollIntoViewIfNeeded )
     1411            e.target.scrollIntoViewIfNeeded(false);
    14121412    });
    14131413
Note: See TracChangeset for help on using the changeset viewer.