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:
parent
c8cd8c8a36
commit
66cb522610
@ -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(){
|
||||
|
Loading…
Reference in New Issue
Block a user