Skip to content

Commit 93bb527

Browse files
committed
File Editor: Prevent the scrolling of current-file into view to also change initially-focused element in Chrome.
Props afercia. Fixes #24048. git-svn-id: https://develop.svn.wordpress.org/trunk@41864 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c888935 commit 93bb527

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/wp-admin/js/theme-plugin-editor.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,12 @@ wp.themePluginEditor = (function( $ ) {
376376
} );
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
};
383387

0 commit comments

Comments
 (0)