Make WordPress Core

Changeset 36426


Ignore:
Timestamp:
01/31/2016 02:02:18 PM (9 years ago)
Author:
afercia
Message:

Menus: after [36379] prevent "Quick Search" form submission when pressing Enter.

Fixes #35374.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/nav-menu.js

    r36379 r36426  
    855855                inputEvent;
    856856
     857            // Prevent form submission.
     858            $( '#nav-menu-meta' ).on( 'submit', function( event ) {
     859                event.preventDefault();
     860            });
     861
    857862            /*
    858              * Use feature detection to determine whether password inputs should use
     863             * Use feature detection to determine whether inputs should use
    859864             * the `keyup` or `input` event. Input is preferred but lacks support
    860865             * in legacy browsers. See changeset 34078, see also ticket #26600#comment:59
     
    866871            }
    867872
    868             $( '.quick-search' ).on( inputEvent, function( e ) {
     873            $( '.quick-search' ).on( inputEvent, function() {
    869874                var t = $(this);
    870 
    871                 if( 13 == e.which ) {
    872                     api.updateQuickSearchResults( t );
    873                     return false;
    874                 }
    875875
    876876                if( searchTimer ) clearTimeout(searchTimer);
Note: See TracChangeset for help on using the changeset viewer.