Themes screens: Lose search input focus when pressing enter.

This allows the keyboard to close on iOS, for example.

props matveb.
fixes #27233.


git-svn-id: https://develop.svn.wordpress.org/trunk@27555 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-03-15 05:13:23 +00:00
parent f4cc32fac9
commit ad650e283b

View File

@ -803,6 +803,11 @@ themes.view.Search = wp.Backbone.View.extend({
event.target.value = '';
}
// Lose input focus when pressing enter
if ( event.which === 13 ) {
this.$el.trigger( 'blur' );
}
this.collection.doSearch( event.target.value );
// if search is initiated and key is not return