Make WordPress Core

Changeset 41864


Ignore:
Timestamp:
10/15/2017 05:36:10 AM (7 years ago)
Author:
westonruter
Message:

File Editor: Prevent the scrolling of current-file into view to also change initially-focused element in Chrome.

Props afercia.
Fixes #24048.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/theme-plugin-editor.js

    r41859 r41864  
    377377
    378378        // Scroll the current file into view.
    379         $templateside.find( '.current-file' ).each( function() {
    380             this.scrollIntoView( false );
     379        $templateside.find( '.current-file:first' ).each( function() {
     380            if ( this.scrollIntoViewIfNeeded ) {
     381                this.scrollIntoViewIfNeeded();
     382            } else {
     383                this.scrollIntoView( false );
     384            }
    381385        } );
    382386    };
Note: See TracChangeset for help on using the changeset viewer.