Code Editor: Remove scrollIntoView of editor's cursor line upon focus to prevent jumping issues for editor scroll position.

See #41850, #41879.

Built from https://develop.svn.wordpress.org/trunk@41385


git-svn-id: http://core.svn.wordpress.org/trunk@41218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter
2017-09-17 03:58:44 +00:00
parent e5b3921ca4
commit c8eb741afd
3 changed files with 2 additions and 9 deletions

View File

@@ -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;