Make WordPress Core

Ticket #27553: dont-move-focus-from-title-to-post.patch

File dont-move-focus-from-title-to-post.patch, 917 bytes (added by afercia, 11 years ago)

removes moving focus from Title to the editor when tabbing forwards

  • src/wp-admin/js/post.js

     
    484484                $previewField.val('');
    485485        });
    486486
    487         // This code is meant to allow tabbing from Title to Post content.
    488         $('#title').on( 'keydown.editor-focus', function( event ) {
    489                 var editor, $textarea;
    490 
    491                 if ( event.keyCode === 9 && ! event.ctrlKey && ! event.altKey && ! event.shiftKey ) {
    492                         editor = typeof tinymce != 'undefined' && tinymce.get('content');
    493                         $textarea = $('#content');
    494 
    495                         if ( editor && ! editor.isHidden() ) {
    496                                 editor.focus();
    497                         } else if ( $textarea.length ) {
    498                                 $textarea.focus();
    499                         } else {
    500                                 return;
    501                         }
    502 
    503                         event.preventDefault();
    504                 }
    505         });
    506 
    507487        // Autosave new posts after a title is typed
    508488        if ( $( '#auto_draft' ).val() ) {
    509489                $( '#title' ).blur( function() {