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
This commit is contained in:
parent
dced797c3f
commit
2d1ac710e2
|
@ -180,13 +180,6 @@ if ( 'undefined' === typeof window.wp.codeEditor ) {
|
||||||
codemirror.on( 'blur', function() {
|
codemirror.on( 'blur', function() {
|
||||||
$textarea.data( 'next-tab-blurs', false );
|
$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 ) {
|
codemirror.on( 'keydown', function onKeydown( editor, event ) {
|
||||||
var tabKeyCode = 9, escKeyCode = 27;
|
var tabKeyCode = 9, escKeyCode = 27;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue