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

Fixes #35374.

git-svn-id: https://develop.svn.wordpress.org/trunk@36426 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2016-01-31 14:02:18 +00:00
parent c8cd8c8a36
commit 66cb522610

View File

@ -854,8 +854,13 @@ var wpNavMenu;
var searchTimer,
inputEvent;
// Prevent form submission.
$( '#nav-menu-meta' ).on( 'submit', function( event ) {
event.preventDefault();
});
/*
* Use feature detection to determine whether password inputs should use
* Use feature detection to determine whether inputs should use
* the `keyup` or `input` event. Input is preferred but lacks support
* in legacy browsers. See changeset 34078, see also ticket #26600#comment:59
*/
@ -865,14 +870,9 @@ var wpNavMenu;
inputEvent = 'keyup';
}
$( '.quick-search' ).on( inputEvent, function( e ) {
$( '.quick-search' ).on( inputEvent, function() {
var t = $(this);
if( 13 == e.which ) {
api.updateQuickSearchResults( t );
return false;
}
if( searchTimer ) clearTimeout(searchTimer);
searchTimer = setTimeout(function(){