From 2d1ac710e270f2c70d26a685c014efd3214151df Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 17 Sep 2017 03:57:09 +0000 Subject: [PATCH] Code Editor: Remove `scrollIntoView` of editor's cursor line upon focus to prevent jumping issues for editor scroll position. See #41850, #41879. git-svn-id: https://develop.svn.wordpress.org/trunk@41385 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/code-editor.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/wp-admin/js/code-editor.js b/src/wp-admin/js/code-editor.js index e2f187c15f..884ead1c2a 100644 --- a/src/wp-admin/js/code-editor.js +++ b/src/wp-admin/js/code-editor.js @@ -180,13 +180,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) { codemirror.on( 'blur', function() { $textarea.data( 'next-tab-blurs', false ); }); - codemirror.on( 'focus', function() { - if ( codemirror.display.cursorDiv.scrollIntoViewIfNeeded ) { - codemirror.display.cursorDiv.scrollIntoViewIfNeeded(); - } else { - codemirror.display.cursorDiv.scrollIntoView(); - } - }); codemirror.on( 'keydown', function onKeydown( editor, event ) { var tabKeyCode = 9, escKeyCode = 27;