Make WordPress Core

Ticket #26633: 26633.patch

File 26633.patch, 836 bytes (added by ocean90, 11 years ago)
  • src/wp-admin/js/customize-controls.js

     
    918918                        body = $( document.body ),
    919919                        overlay = body.children('.wp-full-overlay');
    920920
    921                 // Prevent the form from saving when enter is pressed.
     921                // Prevent the form from saving when enter is pressed on an input element.
    922922                $('#customize-controls').on( 'keydown', function( e ) {
    923                         if ( $( e.target ).is('textarea') )
    924                                 return;
     923                        var isEnter = ( 13 === e.which ),
     924                                $el = $( e.target );
    925925
    926                         if ( 13 === e.which ) // Enter
     926                        if ( isEnter && ( $el.is( 'input:not([type=button])' ) || $el.is( 'select' ) ) ) {
    927927                                e.preventDefault();
     928                        }
    928929                });
    929930
    930931                // Initialize Previewer